Re: [Dev-C++] Possibility to get a string out of a char* or cstring
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2007-07-23 14:23:58
|
Just construct a std::string with the zero-terminateed C string as parameter. /pwm On Mon, 23 Jul 2007, Wagner, Frank wrote: > Hi, > > I wrote a commandline tool that users the argv argument like > -f=3Dfilename.txt. > My problem is that argv is defined as char* but I would like to get the > filename.txt converted to a c++ string wich comes with <string> not > <cstring>. > Does someone has a solution how to convert from cstring to string? > > Thanks in advance > > Frank > -- > WIKA Alexander Wiegand GmbH & Co. KG > Alexander-Wiegand-Stra=DFe 30 - 63911 Klingenberg - Germany > Kommanditgesellschaft: Sitz Klingenberg - Amtsgericht Aschaffenburg HRA 1= 819 > Komplement=E4rin: WIKA Alexander Wiegand Verwaltungs GmbH - Sitz Klingenb= erg - > Amtsgericht Aschaffenburg HRB 306 > Gesch=E4ftsf=FChrer: Alexander Wiegand > Telefon: (09372) 132-0 > Internet: www.wika.com > -- > The information contained in this E-mail and any attached files are stric= tly confidential and may be subject to legal privilege. If you are not the = intended recipient, his representative or the person responsible for delive= ring the message to the intended recipient, be advised that you have receiv= ed this message in error and that any dissemination, copying or use of this= message or attachment is strictly forbidden, as is the disclosure of the i= nformation therein. If you have received this E-mail in error, please notif= y us immediately by E-mail or telephone and delete this message and all its= attachments subsequently. All reasonable precautions have been taken to en= sure no viruses are present in this E-mail. > > |