手工皮具工作室:在C语言里面,有atoi()这个函数吗?

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 17:59:02
如果有,请问这个函数的功能是什么?

函数名: atoi
功能: 把字符串转换成长整型数
用法: int atoi(const char *nptr);
程序例:
#include
#include

int main(void)
{
int n;
char *str = "12345.67";

n = atoi(str);
printf("string = %s integer = %d\\n", str, n);
return 0;
}

就是将字符串转换为长整数的函数

有的,你在tc里面键入atio,然后在上面单击右键,你会看到对该函数的介绍

你在tc里将光标移到atio下面,然后按ctrl+f1,你会看到对该函数的介绍