Question: Object Oriented Programming C++ Write a function that, when you call it, displays a message telling how many times it has been called: I have

Object Oriented Programming C++

Write a function that, when you call it, displays a message telling how many times it has been called: I have been called 3 times, for instance. Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use a global variable to store the count. Second, use a local static variable. Which is more appropriate? Why cant you use a local variable?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!