请问如何将字符串变量转换成整型和浮点型变量,多谢各位高手指点
解决方案 »
- CSocket的OnReceive的问题??
- 关于完成端口的问题
- 自己写SOCKET程序发送电子邮件,使用UTF-8、gb2312编码邮件内容在outlook或者 Foxmail中都正常显示。
- 又一个菜鸟问题,,关于在窗口中绘制矩形图形的问题~
- 谢谢各位大虾.小弟急求:关于调用WINIO.DLL的.愿代码!(比如用VC 得到机台的BIOS 版本,CPU SIZE,RAM SIZE,HDD FIRMWARE,ODD FIRMWARE, MAC
- CString问题
- 为什么程序不能运行?
- 用MFC如何将背景设置为黑色?
- 关于classwizard的一个问题
- (a->x - b->x) * (a->x - b->x) + (a->y - b->y) * (a->y - b->y)是什么意思
- 关于线程的表示ID问题,谢谢赐教!
- vc 中如何取得系统安装目录?
double atof(const char *string);
int ati(const char *string);int64
atoi64(const char *string);
long atol(const char *string);
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 */i = atol( s );
printf( "atol test: ASCII string: %s\t\tlong: %ld\n", s, l );
atof()
strtol()
strtoul()