Original Post
The problem here is that I get a prompt returning
0
0
Press any key to continue.
instead of
0
333
Press blah blah
class TestClass
{
public:
int TestNum;
};
vector<TestClass> TC(5);
TestClass TestFunction()
{
return TC[0];
}
void main()
{
TC[0].TestNum = 0;
cout << TC[0].TestNum << endl;
TestFunction().TestNum = 333;
cout << TC[0].TestNum << endl;
}
Though, if I replace TestFunction.TestNum = 333; with TC[0].TestNum = 333;, it works. Though, I dont want to use that... or else, I wouldn''t be testing this.