Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

Is there any way we could convert the given number are as the character array?? either it may be a floating point and integer. This should be done without using any kind of built in string functions.. Any suggestion guys?

OpenStudy (anonymous):

this needs a good answer mates :).. do help it out to find that ...

OpenStudy (anonymous):

mm this one i dont know a good anwser i have allways use functions built one. From number to string, just use mod / 10 and get digits one by one an build the string From string to number do the inverse, if its an integer, supose its d0d1d2...dn a digit of size n. So u gotta do number = d0*10^n-1 + d1*d1^n-1 + ... + dn. U just need a funtion or array that maps u a single character to a num. "9" to 9, "8" to 8 and so on. If its a float well u just do the same for the natural part, and do the same procedure for the decimal. For example d0d1...dn.dc0dc1...dcm number = d0*10^n-1 + d1*d1^n-1 + ... + dn + dc0*10^-1 + dc1*10^-2 + .... + dc*10^-(m+1). If its negative u just gotta do number = -number. U can do this easy with a graph, like an automaton, like the ones u use in regular expression.

OpenStudy (anonymous):

@fedep3 thanks for the reply, but I am more concerned with float to string, like we do a mod 10 this will surely work for the integer. but the floating point number, is there any way??

OpenStudy (anonymous):

fmod, remember alchemista told it too u in another question, i think

OpenStudy (anonymous):

@fedep3 ya ya I do remember that... will try tht...

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Breathless: Spooky witch but cute
3 hours ago 3 Replies 0 Medals
Arriyanalol: help
3 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 3 Medals
Jaded012023: Please tell me what you all think of this song
6 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
6 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!