Re: [問題] C語言 - Struct 在大型程式專案中的使用?
看板C_and_CPP (C/C++)作者littleshan (我要加入劍道社!)時間16年前 (2009/04/04 10:53)推噓1(1推 0噓 6→)留言7則, 3人參與討論串3/3 (看更多)
pc.h:
#ifndef PC_H
#define PC_H
struct pc {
int a;
int b;
};
struct pc2 {
int c;
int d;
};
extern struct pc pcgame;
extern struct pc2 pcgame2;
#endif // PC_H
main.c:
#include "pc.h"
struct pc pcgame = {1, 2};
struct pc2 pcgame2;
XXX.c:
#include "pc.h"
void f(void)
{
...
if(pcgame.a > pcgame.b){
...
}
pcgame2.c = rand();
...
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.121.113.53
推
04/04 10:59, , 1F
04/04 10:59, 1F
→
04/04 11:00, , 2F
04/04 11:00, 2F
→
04/04 11:10, , 3F
04/04 11:10, 3F
→
04/04 11:33, , 4F
04/04 11:33, 4F
→
04/04 11:36, , 5F
04/04 11:36, 5F
→
04/04 11:40, , 6F
04/04 11:40, 6F
→
04/04 11:41, , 7F
04/04 11:41, 7F
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
-10
29