home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_08 / 455.jpg < prev    next >
Joint Photographic Experts Group Image  |  2014-01-29  |  535KB  |  2550x3300
Labels: book | crt screen | reckoner
OCR: Global versus Local Variables 455 Example 8-5: global.c ql obal all. led Synopsis Ass igns values to some variables and displays those values will in Obj ective I1 lustrates the difference between global and local variables Include Files pro- #incl lude <stdio h> am Global Vari ables int globalvar; Note int same name Note Funct ion Prototy ypes void sub fcn void PRECONDITION: none. refer state POSTCONDITION: Assi igns values to local and global variables and displ lays the values an be sts of the ation int main( void ne of int localvar; Note2 can ions a obalvar Note 3 local lvar Note 4 printf( "Sta rt ing in ma in, of b pr intf( "globalvar sd, localvar is Bd. \n" This globa lvar loca lvar sub fcn; ocal printf( nAfter returning to main, Note 9 printf( "globa alvar is &d, lccalvar is 3d, In" ...