2014年3月12日 星期三

C語言程式 K&R第二版

看書看到的問題 隨手查查的知識
  • 宣告(declaration)&定義(definition)  與 extern

第三個網站我覺得解釋的很好~ 整理出五個結論
1. Declaration can be done any number of times but definition only once.
2. “extern” keyword is used to extend the visibility of variables/functions().
3. Since functions are visible through out the program by default. The use of extern is not needed in function declaration/definition. Its use is redundant.
4. When extern is used with a variable, it’s only declared not defined.
5. As an exception, when an extern variable is declared with initialization, it is taken as definition of the variable as well.


之後看了啥在繼續寫

沒有留言:

張貼留言