Better examples generally result in better replies, but...
Code:
#include <iostream>
int GlobalVariable1;
class Class1
{
public:
void Function1(int Argument1);
};
void Class1::Function1(int Argument1)
{
/* I want the Argument1 in Class1 to be subtracted from the GlobalVariable1,
which is not in the class. The code would be here! */
GlobalVariable1 -= Argument1;
}
int main()
{
Class1 Obj1;
std::cout << "GlobalVariable1 = " << GlobalVariable1 << '\n';
Obj1.Function1(5);
std::cout << "GlobalVariable1 = " << GlobalVariable1 << '\n';
}
/* my output
GlobalVariable1 = 0
GlobalVariable1 = -5
*/