Simple code that won't work

Started by
2 comments, last by Penguinzchaseme 19 years, 11 months ago

#include <iostream>
#include <string>

using namespace std;

int main()
{
   string s;
   cin >> s;
   cout << s;
   cin >> s;
}
 
when I run this and I start to input the string, the input stops after I hit about 200 characters and it just won''t let me type anymore. It''s a continuos string of the number one. I''m running a g++ compiler. Has anyone else had this problem or has any input? When Penguins are chasing you, resistance is futile, give into their demands and they may spare you
When Penguins are chasing you, resistance is futile, give into their demands and they may spare you
Advertisement
quote:Original post by Penguinzchaseme
the input stops after I hit about 200 characters

stops? You type more but the string only contains 200? it won''t let you type any more? the program crashes after 200? you''re running it on a robot and the robot stops when you type 200 ones? (and then turns around and slaps you?)
Nope. I just inputted about 800 1's and it still let me input some more.

I think that 200 characters limit is from the old days of DOS.

edit: vs.net btw

[edited by - alnite on May 17, 2004 5:47:24 PM]
The Visual C++ .NET optimizing compiler is available for free on the Microsoft site now - you might want to try that. Search for "visual C++ .toolkit".

This topic is closed to new replies.

Advertisement