如何将字符型("12.34") 转换带小数的数值型(12.34)????????????
解决方案 »
- 使用ShellExecute运行某程序后...怎么得到那个程序的PID
- 怎么获得父窗口中某个控件,其中的变量?
- 请帮忙提供思路:socket & ftp
- 往树形控件中InserItem,遇到这个问题Warning: implicit LoadString(15) failed,不知道怎么回事啊。
- 存在与此文件有相同名字的文件夹,并且他们在同一路径下,如何去掉这个文件的扩展名?
- 请看一下我的DLL的错误??--高分---高分
- 有朋友告诉我说,这样可以解决我的问题,可是我还有一点没有弄清楚,我的原始问题是:如何手动使得某一个菜单项的某一个子项变灰(失去功
- 时间计算的 程序 有吗
- 高分求教
- 怎么将两段CString的字符串连在一起??
- 急!急!急!菜鸟勿进!
- 如何实现这样一个很小的功能?(50分)
s = "7.8912654773d210"; /* Test of atof */
x = atof( s );
printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x );
http://www.csdn.net/Develop/Read_Article.asp?id=12365
http://www.vckbase.com/study/article/data_convert.htm
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 );
}
Outputatof 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