jump to navigation

c-faq review and a chinese translation (1.11) February 15, 2007

Posted by TSAI HONG-BIN in Programming.
trackback

please refer to http://c-faq.com/decl/extern.html for the origin

1.11 What does extern mean in a function declaration?


extern
is significant only with data declarations. In function declarations, it can be used as a stylistic hint to indicate that the function’s definition is probably in another source file, but there is no formal difference between

extern int f();

and

int f();

See also question 1.10.

References: ISO Sec. 6.1.2.2, Sec. 6.5.1
Rationale Sec. 3.1.2.2
H&S Secs. 4.3,4.3.1 pp. 75-6

函式宣告時的 extern 代表什麼意思?

extern 只有在資料宣告時有意義。在函式宣告時,它可以拿來當作字面上的提示,表示該函式的可能定義在其他源碼,但其實

extern int f();

int f();

並沒有什麼差別。

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: