C++ 类型转换 atoi atol atof stdlib.h, itoa ftoa char --- string.pdfVIP

  • 13
  • 0
  • 约6.3千字
  • 约 7页
  • 2017-05-27 发布于河南
  • 举报

C++ 类型转换 atoi atol atof stdlib.h, itoa ftoa char --- string.pdf

C类型转换atoiatolatofstdlib.h,itoaftoachar---string

1. atoi int atoi ( const char * str ); Convert string to integer Parses the C string str interpreting its content as an integral number, which is returned as an int value. /* atoi example */ #include stdio.h #include stdlib.h int main () { int i; char szInput [256]; printf (Enter a number: ); fgets ( szInput, 256, stdin ); i = atoi (szInput); printf (The value entered is %d. The double is %d.\n,i,i*2); return 0; } output Enter a number: 73 The value entered is 73. The double is 146.

文档评论(0)

1亿VIP精品文档

相关文档