ccplusplus.com
Learn C, C++ Concepts
Sunday, December 25, 2011
variable definition vs declaration example
/*********************************************************************** * File : file3.c * Author : Saurabh Gupta * Desc : external variable in C * Source : http://ccplusplus.com/p/c.html * Created : PM 05:23 25 December 2011 * Note : ************************************************************************/ #include <stdio.h> extern int a1; // declaration of external a1 void next1 (void) { /* * b1 : auto var:- scope local to next1 */ float b1; b1 = 19.2; a1 = 13; // external variable printf ("a1 = %d, b1 = %f\n", a1, b1); // a1 = 13, b1 = 19.2 }
Download Other Files:
1.
file2.c
2.
definition-vs-declaration.c
See Also:
C language Tricky Concepts and Sample Codes
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment