I'm new to C++ so first programs naturally include a calculator.
My memory question is this:
I have a function for each math procedure(add, sub, mul, div,etc)
I have globally declared double a, b, ; for use with all the functions. I have read many places to keep the scope of variables as small as possible...So do the values of a, b, accumulate in memory by declaring them globally?.....ie :
0x00001 = a for first function
0x00002 = b for first function
0x00003 = a for second function
0x00004 = b for second function
or would they over write each other therefore using the same memory space??
A little confused by this ........appreciate any thoughts.....:^)