ccplusplus.com
Learn C, C++ Concepts
Sunday, December 25, 2011
variable definition vs declaration example
/*********************************************************************** * File : file2.c * Author : Saurabh Gupta * Desc : external variable in C * Source : http://ccplusplus.com/p/c.html * Created : PM 05:20 25 December 2011 * Note : ************************************************************************/ #include <stdio.h> int b1 = 0; // definition of external b1 void next (void) { /* * a1 : auto var:- scope local to next */ char a1; a1 = 'a'; b1 = 77; // external variable // printf ("a1 = %c, b1 = %d\n", a1, b1); // a1 = a, b1 = 77 }
Download Other Files:
1.
file3.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