Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi Everyone!
I'm taking a C/C++ course this semester and I'm finding it really hard since I've never taken a programming class before. I'm working on a program right now, and for one part of it I have to convert a string value that is entered by the user to either an integer or a float, using the atoi and atof function. I know I have to declare the #include <stdlib.h> header file, but after that I'm pretty much lost :( My professor isn't much help seeing as how he's never in his office, so any help you all could give me would be greatly appreciated! Thank you so much! =)

Doesn't your compiler have any documentation?? atoi() and atof() are pretty easy to use.
int i;
char string[10] = "123";i = atoi(string);
Reading the book would probably help too!

Thank you Don! =)
Yeah I'd love to read the book but my dear professor said that we didn't need one because his teaching would be good enough. So he didn't order one for the class. Sweet huh :P Thank you so much!! =)

Midnight Blue,
If you want to learn C++, then pick up Dietel's How To Program C++. It is great. It teaches C++ as well as some legacy C.http://www.amazon.com/exec/obidos/tg/detail/-/0130384747/qid=1098969368/sr=8-1/ref=pd_csp_1/002-6999756-6899242?v=glance&s=books&n=507846
It (like all programming books) is expensive...but maybe you can ask for it for your bday or xmas (if you celebrate xmas)
Hope this helps,
Chi"They mostly come at night...mostly"

Thanks Chi! And my birthday is coming up next week as a matter of fact! I'll make sure I'll let someone know abou that book :P

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |