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

請問如何在.c檔裡 include .cpp檔 以及用.cpp檔中的function?

0 views
Skip to first unread message

四輪機車?! -_-a)

unread,
Jul 30, 2004, 2:03:08 AM7/30/04
to

as title
thanks
--
* Post by odincjk from 61-220-246-157.HINET-IP.hinet.net
* Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>

Wisem...@bbs.cs.nthu.edu.tw

unread,
Jul 30, 2004, 10:07:37 AM7/30/04
to
※ 引述《odinc...@bbs.cis.nctu.edu.tw (四輪機車?! -_-"a)》之銘言:
> as title
> thanks


寫一個.h 檔 內容如下

#ifdef __cplusplus
extern "C" {
#endif

/* cpp 檔內function的 prototype 放在中間 */

#ifdef __cplusplus
}
#endif

在此cpp檔與c檔 include 此h檔即可
--
※ Origin: 楓橋驛站<bbs.cs.nthu.edu.tw> ◆ From: NK219-91-117-170.adsl.dynamic.apol.com.tw

0 new messages