-
TBuf to TInt?
Hi!
I've written a little game in C++. It has a toplist file. I store the names and the scores it this file. How can I read the scores as TInt datas? I use TFileText for the read, and read the datas to TBUfs. How can I convert the TBuf type into TInt? Any idea?
Thx for the answers!
Posted by Toth Lorant, tothl@netforum.hu
on April 08, 2002 at 12:12
-
RE: TBuf to TInt?
Posted by Asheesh Sangamneheri, asangamneheri@hotmail.com
on April 08, 2002 at 12:32
hi,
use TLex to convert char to numbers. refer sdk help for details. hope the example also helps...
cheers,
ash
//--------------------------------------------
TBuf8<10>temp;
TLex8 conv; // used to convert TBuf8<> to TInt
TInt num;
ReadFile.Read(temp);
conv=fromfile.Mid(0,3); // read uid
conv.Val(num); // num=conv=temp;