[C] 把字符串转换成长整型数 →→→→→进入此内容的聊天室

来自 , 2019-05-31, 写在 C, 查看 111 次.
URL http://www.code666.cn/view/e45823af
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main ( void )
  5. {
  6.         int n;
  7.         char *str = "12345.67";
  8.  
  9.         n = atoi ( str );
  10.         printf ( "string = %s integer = %d\n", str, n );
  11.         return 0;
  12. }

回复 "把字符串转换成长整型数"

这儿你可以回复上面这条便签

captcha