Whats wrong with my code?
Hey, first off, this is my first time here, hopefully I will be able to give back to the community as my knowledge and programming skills are increased.
I started out in VB6 (stop laughing!) in my high school, and was gunna take AP Java, but it was canceled for the year when only 11 people signed up. Anyway, since then I have been (trying) to teach myself c++, and have just started getting a little more serious about it.
Anyway, I was wondering if someone could tell me what is wrong with this code:
Code:
int sum = 0, value;
//std::cout << "Please enter the numbers to be added" << std::endl;
//read till end of file, calculating a running total of all values read
while (std::cin >> value)
sum += value;
std::cout << "Sum is: " << sum << std::endl;
return 0;
I believe its triggering an infinite wgile loop, but I dont know why. Any information/tips would be appreciated. Thanks!