string manipulation

alexdaman
09-23-2002, 10:13 AM
Hi all!

I have a newbie question...
I have a string[6] containing different numbers, say: "12345"
I want to put a "fake" (decimal) point between "4"and "5"
so that it looks like this: "1234.5".
I DONT want to do any mathematical manipulation. Just simple string manipulation. What functions do you recommend?

Thanks for any help you can provide
Alex Skafidas

orufet
09-23-2002, 11:06 AM
Make string[7] and just shift the position of the numbers. For example, make string[4]='4' and string[6]='5'. Then you have a space for string[5] to equal '.'

noRulez
09-23-2002, 07:22 PM
If you don't know how many digits are in the number, then you'll have to use something like a dynamically allocated array or possibly a linked list(if you want to venture there). It all depends on exactly what your program entails.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum