lab10.1 - i++ return } /* Adding static in front of the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <stdio.h> void f() void g() int main(){ printf("Function F:\n") f() f() f() printf("Function G:\n") g() g() g() return 0 } void f(){ int i = 0 printf("i is: %d", i) i++ return } void g(){ static int i = 0 printf("i is: %d", i)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i++ return } /* Adding static in front of the declaration allocates and initializes int i * only once, prior to the programs execution, and will not re-initialize * every time the function is called. the i in f seems very far away from the * i in g. f's i is in the stack. */...
View Full Document

This lab report was uploaded on 04/06/2008 for the course CISC 105 taught by Professor Mcgeary during the Spring '08 term at University of Delaware.

Ask a homework question - tutors are online