Looking for the EOF character on Windows XP using Visual C++ 6.0

S

Sid

Hi,

I am trying to run this simple C++ code. I am stuck at the DOS prompt
after entering in text as the normal commands like Ctrl-Z or Ctrl-D
used for EOL don't seem to work. I am using Microsoft Visual C++
compiler 6.0 on Windows XP. Any help would be greatly appreciated

#include <string>
#include <vector>
#include <iostream>

using namespace std ;


int main()
{
vector< string> svec;
svec.reserve(1024);

string text_word;

while (cin >> text_word)
svec.push_back(text_word);


svec.resize(svec.size() + svec.size()/2);

cout << "words read are: \n";

for (vector<string>::iterator it =svec.begin(); it !=svec.end(); ++it
)
cout << *it << ' ';
cout << endl;


return 0;

}
 
W

WW

Sid said:
Hi,

I am trying to run this simple C++ code. I am stuck at the DOS prompt
after entering in text as the normal commands like Ctrl-Z or Ctrl-D
used for EOL don't seem to work. I am using Microsoft Visual C++
compiler 6.0 on Windows XP. Any help would be greatly appreciated

<OT>
You need to press enter at least once after all the words are read. And
then CTRL-D. It might be needed to press enter after that, too. I cannot
remember.
</OT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top