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

[Qt-interest] QString to char array

Subject: [Qt-interest] QString to char array
From: Avishek_Sharma
Date: Mon, 29 Dec 2008 10:01:27 +0530
Hi,
    I came across this piece of code to convert/copy from QString to char array.

     char arr[255];
     QString str;
      strcpy(arr,str.toAscii().constData());

will this code work?
I am working on a photo gallery and I need to convert from QString(the file 
path is stored in a variable of type QString)to char array (I haven't yet 
started on  that section ).So, I would appreciate it if someone would let me 
know if this code will work.If you think it won't work then please give me some 
idea of how to do it.
Thanks in advance.

Avi






DISCLAIMER:
This email (including any attachments) is intended for the sole use of the 
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE 
COMPANY INFORMATION. Any review or reliance by others or copying or 
distribution or forwarding of any or all of the contents in this message is 
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the 
sender by email and delete all copies; your cooperation in this regard is 
appreciated.

_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

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