FunctionCounter

FunctionCounter -...

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

View Full Document Right Arrow Icon
// file: FunctionCounter.cpp // author: j. dzuback // modified: yourname // date: today / /* ********************************************************** Program explores the differences in behaviors between variables when they are declared as automatic and when they are declared as static. ********************************************************** */ #include <iostream> using namespace std; u void FunCount(); v /* ********************************************************** The function increments and displays the value of a locally declared integral identifier. Pre Conditions: None Post Conditions: value of integer is displayed.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ********************************************************** */ int main () { FunCount(); FunCount(); FunCount(); return 0; } /* ********************************************************** The function increments and displays the value of a locally declared integral identifier. Pre Conditions: None Post Conditions: value of integer is displayed. ********************************************************** */ void FunCount() { static int counter = 0; counter++; cout << "Counter is. .." << counter; return; }...
View Full Document

This note was uploaded on 02/08/2011 for the course CSC 101 taught by Professor Joedzuback during the Spring '11 term at Union County.

Ask a homework question - tutors are online