作者ckaha (★闪亮数学推理★)
看板EE_DSnP
标题[问题] 关於 .c 变成.o的问题
时间Wed Mar 5 18:07:09 2008
作业中
a.cpp 需要 include a.h b.h
b.cpp 需要 include b.h
main.cpp 需要 include a.h
那我可以先用
a.cpp + a.h -> a.o
b.cpp + b.h -> b.o
main.cpp -> main.o
然後将他们再一起组合成一个执行档
因为我是这样想的
不管如何包含a.h b.h
终究我都会把他们三个兜在一起
所以程式执行的时候他都找的到
这样想可以吗?
还是哪里有错呢?
--
Every thing can be w
rong unless you can proof it is
true.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.4.235
1F:推 timrau:Without including a.h, how could the compiler know what 03/05 18:48
2F:→ timrau:"class A" mean? 03/05 18:48