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 请按任意键继续. . .
时间: 2024-10-10 07:58:12