Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 10-01-2006, 08:42 PM   #1
Baseband Member
 
Join Date: Oct 2005
Posts: 25
Default parsing a constant char? (C++)

I needed to parse a constant char and im having a little problem doing it. I am currently trying to use the strtok function to parse and assigning it to my variable with atoi.

But the string is a constant char and it wont let me make changes to it. What can i do.
__________________

Neoz1 is offline   Reply With Quote
Old 10-02-2006, 01:06 PM   #2
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: parsing a constant char? (C++)

How about making a copy of the string, non-constant so you can parse that and get your results? You'll never, by definition be able to change the constant version, so carry out operations on a "scratch pad" copy. Best notion I have... Hope it helps you out.
__________________

__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 10-02-2006, 03:59 PM   #3
Baseband Member
 
Join Date: Oct 2005
Posts: 25
Default Re: parsing a constant char? (C++)

thanks bro. Worked
Neoz1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 02:13 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0