首页 > 编程知识 正文

atoi是什么意思,atoi

时间:2023-05-05 12:37:20 阅读:251055 作者:801

来自头文件 #include <stdlib.h>

atoi()函数用来将字符串转换成整数(int)

int atoi(const char* str) ;

从流中获取字符串:

char* fgets(char*str, int num, FILE*stream );

num: 最大字符个数,包括终止符号

stream:stdin

#include <stdio.h>#include <stdlib.h>int main(){ int i; char buffer[256]; printf("Enter a number:"); fgets(buffer, 256, stdin); i = atoi(buffer); printf("The value entered is %d.", i); return 0;}

 

转载于:https://www.cnblogs.com/Shinered/p/9865979.html

阿诺德渲染器gpu需要学习么?Comparetrue/falsearraywithotherarrayUCloud云社区

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。

  •  标签:  
  • atoi