AMcASummit
Programmer
Hi: I am having difficulty reading a list of integers entered in the console into a program I am writing. The code I am using is as follows?
int hmwk;
.
.
.
while (cin>>hmwk) {
hmwkVec.push_back(hmwk);
}
As you will see, I wish to populate a vector with the integers that are input at the command line.
I am not sure what the eof character in a windows xp console is. I have read that it might by Ctrl-z. I sometimes have luck with this, but in the current program, I have to hit Ctrl-Z and return 2 or more times before the program reacts as it should to an eof. I get the impression that the program is then processing the other keystrokes I have input and (because of the program's logic) it is then terminating.
int hmwk;
.
.
.
while (cin>>hmwk) {
hmwkVec.push_back(hmwk);
}
As you will see, I wish to populate a vector with the integers that are input at the command line.
I am not sure what the eof character in a windows xp console is. I have read that it might by Ctrl-z. I sometimes have luck with this, but in the current program, I have to hit Ctrl-Z and return 2 or more times before the program reacts as it should to an eof. I get the impression that the program is then processing the other keystrokes I have input and (because of the program's logic) it is then terminating.