I recently made a tiny program to test a mathematical algorithm, but i'm getting some output I can't explain. I think I must have changed a setting or something as this is weird as hell, but if anyone knows what I might've done it'd be greatly appreciated as I'm stumped.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
int main()
{
int n3xTotal = 0;
int n5xTotal = 0;
int nAddCount = 0;
int i = 5;
cout << "i = " << i << endl;
nAddCount = i;
cout << "nAddCount = " << nAddCount;
cout << n3xTotal << endl;
system("PAUSE");
return 0;
}
The new-line escape character constant is the more efficient choice since std::ostream::endl() has significant overhead in relation to the new-line escape character.