View Single Post
  #25 (permalink)  
Old 09-12-2008, 09:32 PM
Aereshaa's Avatar   
Aereshaa Aereshaa is offline
Guru
 
Join Date: Apr 2008
Posts: 585
Last Blog:
I don't like the word ...
Credits: 0
Rep Power: 9
Aereshaa is just really niceAereshaa is just really niceAereshaa is just really niceAereshaa is just really nice
Default Re: Trying to figure out how to get my calculator to "Quit" on command given

It could also help if the implicit call to _exit(0) fails. It never does, though.
Also, there are if_integer and str2int functions in standard C, let alone C++.
It's called strtol. To get an int x from stdin:
Code:
char * str = malloc(200);
str = fgets(str,200,stdin);
char * s2;
int x = strtol(s,NULL,10);
free(s);

Last edited by Aereshaa; 09-12-2008 at 11:25 PM.
Reply With Quote

Sponsored Links