fig16_26.cpp

来自「经典vc教程的例子程序」· C++ 代码 · 共 21 行

CPP
21
字号
// Fig. 16.26: fig16_26.cpp
// Using strtoul
#include <iostream.h>
#include <stdlib.h>

int main()
{
   unsigned long x;
   char *string = "1234567abc", *remainderPtr;

   x = strtoul( string, &remainderPtr, 0 );
   cout << "The original string is \"" << string
        << "\"\nThe converted value is " << x
        << "\nThe remainder of the original string is \""
        << remainderPtr
        << "\"\nThe converted value minus 567 is " 
        << x - 567 << endl;
   return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?