On Fri, 02 Nov 2007 09:33:56 +0100, Stefan Kristensen wrote:

[...]

> I use fgets() to read a string, but don't want to pertain the newline
> charcter. In the old days, I used flushall(), but that doesn't seem to
> be valid either. What do I do here?

The preferred C++ way would be to use the std::string class (defined in 
header <string>). You might then use std::getline() to read into a 
string. It handles newlines sensibly.

In general std::string is *much* nicer than faffing about with char* (the 
C way). Again, check your text book.

Cheers,

-- 
Lionel B
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to