码迷,mamicode.com
首页 > 编程语言 > 详细

C语言 extern4 全局数组

时间:2015-08-16 18:09:18      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

headB.h中:

#ifndef headB_H
#define headB_H
int i = 888;
int arr[5]={1,2,4,5,3};
#endif

.c文件中:

#include "headB.h"
#include <stdio.h>

void main()

{
    int j=0;
    for (;j<5;j++)
    {
        printf("  %d",arr[j]);
    }
    
    printf("\n%d",i);
}

结果:

1 2 4 5 3
888  请按任意键继续. . .

C语言 extern4 全局数组

标签:

原文地址:http://www.cnblogs.com/shuqingstudy/p/4734526.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!