Archived

This topic is now archived and is closed to further replies.

Penguinzchaseme

Simple code that won't work

Recommended Posts

#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

Share this post


Link to post
Share on other sites
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?)

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
Share on other sites