get and getline functions

Hi there !
I have one question about these functions:

- istream& get ( char* s, streamsize n, char delim );
- istream& getline (char* s, streamsize n, char delim );

I modified delim parameter to 's'. Why if I exceed the maximum number of characters to store and then I press "Enter" - it will end of loading? I chosen functions with the delim parameter and I modified it! (If I don't exceed the max number of characters, it will be OK - it'll come to a new line)...

use getline from <string> so you won't have problem with sizes:
1
2
string str;
getline(cin,str,'s');


http://www.cplusplus.com/reference/string/getline/
Topic archived. No new replies allowed.