Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 C++ ifstream, problem T.T

views
     
TSden
post Mar 26 2006, 09:14 AM, updated 19y ago

Plebeian
******
Senior Member
1,633 posts

Joined: Jan 2003
From: Federal Territory of KL Status: Widowed



after getline(myfile,line);

then the string line contains a string of continuous hexadecimal numbers
eg. FF122E....

which library function can i use to 'chop' it into separate hexadecimal numbers so that i can use it to convert back to ascii character?
naim_mahmood
post Mar 26 2006, 01:09 PM

Getting Started
**
Junior Member
105 posts

Joined: Jul 2005


QUOTE(den @ Mar 26 2006, 09:14 AM)
after getline(myfile,line);

then the string line contains a string of continuous hexadecimal numbers
eg. FF122E....

which library function can i use to 'chop' it into separate hexadecimal numbers so that i can use it to convert back to ascii character?
*
<string.h>

checkout on string manipulation

http://forum.lowyat.net/index.php?showtopi...hl=naim_mahmood
dstl1128
post Mar 27 2006, 10:58 AM

Look at all my stars!!
*******
Senior Member
4,463 posts

Joined: Jan 2003
There's no one single function that could chop a long string without a distinctive seperator.

Your best bet are strncpy(), sscanf(), and your own indexing loops.


 

Change to:
| Lo-Fi Version
0.0130sec    0.16    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 07:19 PM