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 / 447.jpg < prev    next >
Joint Photographic Experts Group Image  |  2014-01-29  |  613KB  |  2550x3300
Labels: book | crt screen | poster | reckoner
OCR: Automatic versus Static Variables 447 inside a function block. Suppose the function is called, the value of counter changed during function execution, and then the function is called again. The value of coun ter on each entry to the function would be the same as when exit- ing the function the previous time Example 8-2 illustrates this concept. Note the similarity between this pro- gram static.c, and the prev vious program automatc.c Note also that the output is different Understanding this difference is the key to understanding the difference between automatic and static variables sts of two nent Example 8-2: static.c automatic ement static.c Synopsis Outputs two integer values Ob jective Illustrates static variables Incl lude Files #incl Lude <stdio h Funct. ion Prototypes .nt incr remen ...