Click here to Skip to main content
15,883,603 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert string to integer Pin
CPallini16-Apr-08 0:50
mveCPallini16-Apr-08 0:50 
GeneralRe: convert string to integer Pin
jhwurmbach16-Apr-08 2:07
jhwurmbach16-Apr-08 2:07 
GeneralRe: convert string to integer Pin
Cedric Moonen16-Apr-08 2:10
Cedric Moonen16-Apr-08 2:10 
JokeRe: convert string to integer Pin
Hamid_RT16-Apr-08 4:42
Hamid_RT16-Apr-08 4:42 
GeneralRe: convert string to integer Pin
ThatsAlok30-Jun-09 23:11
ThatsAlok30-Jun-09 23:11 
GeneralRe: convert string to integer Pin
Schehaider_Aymen16-Apr-08 0:41
Schehaider_Aymen16-Apr-08 0:41 
GeneralRe: convert string to integer Pin
enhzflep16-Apr-08 0:42
enhzflep16-Apr-08 0:42 
GeneralRe: convert string to integer Pin
finalman16-Apr-08 16:15
finalman16-Apr-08 16:15 
A example in MSDN
--------------------------------
Example

/* ATOF.C: This program shows how numbers stored
* as strings can be converted to numeric values
* using the atof, atoi, and atol functions.
*/

#include <stdlib.h>
#include <stdio.h>

void main( void )
{
char *s; double x; int i; long l;

s = " -2309.12E-15"; /* Test of atof */
x = atof( s );
printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x );

s = "7.8912654773d210"; /* Test of atof */
x = atof( s );
printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x );

s = " -9885 pigs"; /* Test of atoi */
i = atoi( s );
printf( "atoi test: ASCII string: %s\t\tinteger: %d\n", s, i );

s = "98854 dollars"; /* Test of atol */
l = atol( s );
printf( "atol test: ASCII string: %s\t\tlong: %ld\n", s, l );
}


Output

atof test: ASCII string: -2309.12E-15 float: -2.309120e-012
atof test: ASCII string: 7.8912654773d210 float: 7.891265e+210
atoi test: ASCII string: -9885 pigs integer: -9885
atol test: ASCII string: 98854 dollars long: 98854
GeneralRe: convert string to integer Pin
ThatsAlok30-Jun-09 23:10
ThatsAlok30-Jun-09 23:10 
Questiondll problem Pin
trioum15-Apr-08 23:27
trioum15-Apr-08 23:27 
GeneralRe: dll problem Pin
Cedric Moonen15-Apr-08 23:30
Cedric Moonen15-Apr-08 23:30 
GeneralRe: dll problem Pin
MANISH RASTOGI15-Apr-08 23:32
MANISH RASTOGI15-Apr-08 23:32 
GeneralRe: dll problem Pin
CPallini15-Apr-08 23:35
mveCPallini15-Apr-08 23:35 
GeneralRe: dll problem Pin
trioum16-Apr-08 0:08
trioum16-Apr-08 0:08 
QuestionRe: dll problem Pin
CPallini16-Apr-08 0:17
mveCPallini16-Apr-08 0:17 
GeneralRe: dll problem Pin
trioum16-Apr-08 0:30
trioum16-Apr-08 0:30 
GeneralRe: dll problem Pin
CPallini16-Apr-08 0:36
mveCPallini16-Apr-08 0:36 
GeneralRe: dll problem Pin
trioum16-Apr-08 0:41
trioum16-Apr-08 0:41 
GeneralRe: dll problem Pin
CPallini16-Apr-08 0:49
mveCPallini16-Apr-08 0:49 
GeneralRe: dll problem Pin
Cedric Moonen16-Apr-08 0:39
Cedric Moonen16-Apr-08 0:39 
GeneralRe: dll problem Pin
trioum16-Apr-08 0:47
trioum16-Apr-08 0:47 
GeneralRe: dll problem Pin
Cedric Moonen16-Apr-08 0:53
Cedric Moonen16-Apr-08 0:53 
GeneralRe: dll problem Pin
trioum16-Apr-08 1:01
trioum16-Apr-08 1:01 
GeneralRe: dll problem Pin
trioum16-Apr-08 1:31
trioum16-Apr-08 1:31 
GeneralRe: dll problem Pin
Cedric Moonen16-Apr-08 1:42
Cedric Moonen16-Apr-08 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.