C 语言实例 - 数组拷贝

C 语言教程 · 2019-02-21 06:57:59

将一个数组复制给另外一个数组:

实例

#include <stdio.h> int main() { int original[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}; int copied[10]; int loop; for(loop = 0; loop < 10; loop++) { copied[loop] = original[loop]; } printf("元素数组 -> 拷贝后的数组 \n"); for(loop = 0; loop < 10; loop++) { printf(" %2d %2d\n", original[loop], copied[loop]); } return 0; }

输出结果为:

元素数组 -> 拷贝后的数组 
    1         1
    2         2
    3         3
    4         4
    5         5
    6         6
    7         7
    8         8
    9         9
    0         0

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

Domain-Driven Design

Domain-Driven Design

Eric Evans / Addison-Wesley Professional / 2003-8-30 / USD 74.99

"Eric Evans has written a fantastic book on how you can make the design of your software match your mental model of the problem domain you are addressing. "His book is very compatible with XP. It is n......一起来看看 《Domain-Driven Design》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具