Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Feb 23rd, 2006, 9:55 PM   #1
myName
Programmer
 
Join Date: Oct 2005
Posts: 48
Rep Power: 0 myName is on a distinguished road
char *

I have a a string
char *chMsg = "02222AAA00";

i wana separate this "02222AAA00" into part by part..
Like this "0", "2222", "AAA", "00".

so i declared 4 variables

	
char *chOne = new char[1]; //"0"
char *chTwo = new char[4]; //"2222"
char *chThree= new char[3]; //"AAA"
char *chFour = new char[2]; //"00"

than,
i use strncpy
strncpy(chOne, chMsg, 1);
to get the "0" from "02222AAA00".

but how to get the "2222" from "02222AAA00"???
myName is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC