String Declaration and Input

Started by
1 comment, last by mkoday 22 years, 4 months ago
If I am to declare a string of unknown size and the user is to input a string containing alphanumeric characters and spaces, what would be the most efficient way to declare and accept input?
Advertisement
i think its getline(cin,stringname)
barazor is correct. You might just want to look up MS'' getline bugfix if you use MSVC. The version of the Standard C++ Library that shipped with MSVC6 has a bug in the ''string'' template implementation file that causes it to read an extra character after encountering the terminating delimiter.

(Thanks Martee!)

This topic is closed to new replies.

Advertisement