GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Apr-2004, 07:36
Rolapin Rolapin is offline
New Member
 
Join Date: Apr 2004
Posts: 1
Rolapin is on a distinguished road
Question

string conversion + pointers


I'm trying to convert TText into std::string but I encounter a problem: only the first letter is received...

I do this:
CPP / C++ / C Code:
typedef ListIterator<A*> AIterator;
// AIterator is an iterator on A* objects
AIterator iter = pDefinition->First() ;
// iterator initialization

std::string l_string ; // string type local variable
TText * l_ttext ; // TText type local variable

l_ttext = const_cast<TText *> ((*iter)->Name().CPtr()) ;

// the problems are on this line I think...

l_string = std::string((char *)l_ttext) ;

Knowing that Name() send a special string and that CPtr() convert it into
CPP / C++ / C Code:
TText * 
(const TText* CPtr() const; )
Is anything not right ?

Thanks !
Thomas
Last edited by dsmith : 02-Apr-2004 at 07:49. Reason: Use [c] & [/c] to highlight c code
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AdSonar spider / bot useragent string JdS Advertising & Affiliates Forum 1 10-Mar-2006 16:05
Including Maps and strings?? maddie C++ Forum 17 05-Jul-2004 06:25
string comparison soccer022483 C++ Forum 2 21-Mar-2004 21:13
[function] AutoLink (converts URLS into links inside a string) JdS PHP Code Library 0 26-Jan-2004 05:02
storing a token pointer as a string CoreLEx C Programming Language 1 07-Oct-2003 11:33

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:45.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.