Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Sid
Guest
 
Posts: n/a
#1: Jul 19 '05
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;

}

WW
Guest
 
Posts: n/a
#2: Jul 19 '05

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


Sid wrote:[color=blue]
> 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[/color]

<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>

--
WW aka Attila


Closed Thread