qt-interest@trolltech.com
[Top] [All Lists]

Re: File read problem

Subject: Re: File read problem
From: "Duane Hebert"
Date: Thu, 1 Mar 2007 11:44:58 -0500
"Dimitri" <dimitri@xxxxxxxxxxxxx> wrote in message
news:es6va8$i4m$1@xxxxxxxxxxxxxxxxxxxxx
>      for(vector<string>::iterator it = buffervec.begin(); it !=
> buffervec.end(); ++it)
>      {
>          qDebug("%s", it->c_str());
>          dataBuffer.append(QString(*it));
>      }
>

But he's doing:

 qDebug("%s", ((string)(*it)).c_str());
  dataBuffer.append(*it);


i.e. using a c style cast to cast *it to a string.
This is not necessary.
qDebug("%s",*it.c_str());   should work no?
But more probably the problem, is the next
line where he's appending a std::string to a QString.
Does that actually work?

Maybe changing that to:
databuffer.append(*it.c_str());  would be better.
Or will this cause problems with nulls?
Well he said it was a text file but...


--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>