// Exam032703.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
using namespace std;
int main()
{
char buf[20];
strcpy_s(buf, "10");
int i = atoi(buf);
long l = atol(buf);
float f = atoi(buf);
printf("%d\n", i);
printf("%d\n", l);
printf("%f\n", f);
}
c++字符串和数字转换
猜你喜欢
转载自blog.csdn.net/dxm809/article/details/115267068
今日推荐
周排行