Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++ 求助: 很奇怪現象??inline 函式的問題

0 views
Skip to first unread message

superstition

unread,
Dec 27, 2003, 11:48:00 PM12/27/03
to
我有2個檔案,1 個是 1.CPP , 另一個是 2.CPP

1.CPP
#include
inline void abc()
{
cout<<123;
}
void def();
void main()
{
def();

}
_______________________

2.CPP
#include
void abc();
void def()
{
abc();
}

使用專案連結時,2.CPP找不到abc()函式之定義,可是在1.cpp中 abc()函式
屬全域阿??除非在1.cpp中先呼叫一次abc(),link時2.cpp就不會錯誤.
EX:在main()中呼叫abc(), link時就不會錯誤.請問是什麼原因??
--
[1;31m※ Origin: [36m逢甲蒼穹資訊網<bbs.fcu.edu.tw> [33m◆ From: [35m10.30.105.6 [m

0 new messages