Hello! I found this example online and am trying to play around with it.
I know it is possible to get the sum of the array in the PutData() member function, but how can you pass this to the main () to use as a variable properly? I understand it is probably best to have a member function for sum, but for simplicity, I think you should understand what I am trying to do.
I have been successful at calling the members in main and outputting the sum, but how can I assign it to a new variable to use in main () using best practices?
In member function 'void Employee::PutData()':
31:21: error: 'sum' was not declared in this scope
31:27: error: 'id' was not declared in this scope
31:32: error: 'age' was not declared in this scope