Big string

Well, I need a string that holds about 10000 characters, but cin get stuck somewhere around 4000-5000. I tried using a string, and an array of chars.
Last edited on
What do you mean by "get stuck"? std::string is able to hold much bigger strings than 10000 characters.
well I just can't cin more chars. I think it's because of cin.
How do you read from std::cin? How do you add the characters to the string?
string a;
cin>>a;
cin>>a;
What this does is that it skips any white space characters until it finds a non-white space character and appends all characters to a until it finds a white space character or EOF. So my guess is that it finds a white space character after about 4000-5000 characters, and that's why a doesn't get any bigger than that.
Last edited on
I'm not going to sign up on that site only to view your input.
you can log in with google account or yahoo
Are you seriously suggesting I should give away the log in details of my google account to a site I have never seen before? I'm not that stupid.

EDIT: I see now that the log in method is probably safe but I don't want to give away my email address.
Last edited on
Anyway my input doesn't have any spaces. Any other suggestions?
I have just tried using a char and appending it to a string and it doesn't work either.
Space is not the only white space character.
here is the problem http://rosalind.info/problems/prot/
you can check the input there.
Topic archived. No new replies allowed.