Well . . .
To follow those exact steps you would create the class
declare a pointer of it in the main function
send it's variables into the function and then when the function modifies the value of the pointer
it actually modifies the number globally
NOW ON THE OTHER HAND
this does work but is very sloppy
what I would do is add the function to the class
then you can access all of the variables in your class through that function
so you could make a function that increments each variable
and a function that outputs each variable
and everytime you want to add to that variable just call the function
=P
~ Geo
~ You are unique, just like everyone else
|