home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2119
Discussions: 186,677, Posts: 2,227,822, Members: 230,321
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old October 16th, 2003, 10:02 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Oct 2003
Posts: 3
Unhappy
ignorant student needs help w/ C

Is there a way to convert char[] of 40 single digits into a double, process it, then break it back up into individual digits and store it back in the char[]? I know it sounds simple enough but I can't figure it out.

I've tried to use atof() and then sprintf(), but can't even get the right value out of atof().

Please help.

Thanx,
Eric

allenericc is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old October 23rd, 2003, 09:00 PM     #2 (permalink)
Member
 
Join Date: Apr 2002
Location: Georgia
Posts: 137
Re: ignorant student needs help w/ C

Quote:
Originally posted by allenericc
Is there a way to convert char[] of 40 single digits into a double, process it, then break it back up into individual digits and store it back in the char[]? I know it sounds simple enough but I can't figure it out.

I've tried to use atof() and then sprintf(), but can't even get the right value out of atof().

Please help.

Thanx,
Eric
I think you'd just do something like

char characters[40];

/*Initialize the character array in some way*/

double* dubnum;
dubnum=(double*)characters;

/*Do whatever the hell you want with dubnum as a double, remembering to dereference it first, and then, when you are finished, as a side-effect, characters will already be your 40 character array, worked on by the processes you were using on the double*/

If that doesn't work, then tell me what you are trying to do because otherwise I'm confused.
__________________
Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®

Jüš† ä gü¥ is offline   Reply With Quote
Reply


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

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (659)
Best Boot Drive Imaging Software (9)
Video card compatability. (7)
Bought an AGP "HIS Radeon HD 3.. (18)
File associations (5)
Outlook add-in won't remove. (10)
Is this a good laptop for gamming? (6)
Misery Loves Company... (1873)
Presario Help (6)
Recent Discussions
FS: Dell 6000 laptop, modded 36.. (3)
[Help] Computer Freeze (4)
Putting together my wish list (21)
Acer SA80 Upgrade (2)
Best Boot Drive Imaging Softwar.. (9)
Computer won't start (10)
Fallout 3 problem (2)
Move folders from desktop to My.. (2)
graphics card driver issue (1)
What graphics card range for q9.. (1)
Seald copy of windows 95 for sa.. (1)
Magellan RoadMate 1412 GPS Perf.. (2)


All times are GMT -4. The time now is 09:21 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28