help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help using getline(char_type*, streamsize)


From: Ulrich Eckhardt
Subject: Re: Help using getline(char_type*, streamsize)
Date: Wed, 05 Oct 2005 19:11:01 +0200
User-agent: KNode/0.8.2

jalkadir wrote:
> I am trying to get character string from the user, to do that I use
> getline(char_type*, streamsize), but I get a segmentation fault??!!
> 
> Can anyone give me a hand, what am I doing wrong?

Someone else said what's wrong already, but I think there's a better
alternative:

std::string line;
if(std::getline( std::cin, line))
{
   // use line
}

Uli
-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]