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