代码拉取完成,页面将自动刷新
#include <stdio.h>
int main(int argc, char *argv[])
{
int ages[] = {23, 43, 12, 89, 2};
char *names[] = {
"Alan", "Frank",
"Mary", "John", "Lisa"};
//printf("test for first e of array : %d\n", *ages);
int count = sizeof(ages) / sizeof(int);
int i = 0;
for (i = 0; i < count; i++) {
printf("%s has %d years alive.\n", names[i], ages[i]);
}
printf("------\n");
int* cur_age = ages;
char** cur_name = names;
for (i = 0; i < count; i++) {
printf("%s has %d years alive.\n", *(cur_name+i), *(cur_age));
}
printf("-----------");
for (i = 0; i < count; i++) {
printf("%s has %d years alive.\n", cur_name[i], cur_age[i]);
}
printf("--------------------\n");
for (cur_name = names, cur_age = ages; (cur_age - ages) < count; cur_age++, cur_name++ ) {
printf("%s has %d years alive.\n", *cur_name, *cur_age);
}
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。