📄 ex09_09.c
字号:
#include <stdio.h>
#define SIZE 10
/* function prototypes */
void addarrays( int [], int []);
int main( void )
{
int a[SIZE] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
int b[SIZE] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
addarrays(a, b);
return 0;
}
void addarrays( int first[], int second[])
{
int total[SIZE];
int *ptr_total = &total[0];
int ctr = 0;
for (ctr = 0; ctr < SIZE; ctr ++ )
{
total[ctr] = first[ctr] + second[ctr];
printf("%d + %d = %d\n", first[ctr], second[ctr], total[ctr]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -