书上的十六进制转换的例子,输出时出现错误
#include <iostream>
using namespace std;
int main() {
const string hexdigits = "0123456789ABCDEF";
cout << "Enter a series of numbers between 0 - 15" <<
"separated by space . Hit Enter when finished : " <<endl;
string result;
string::size_type n;
while (cin >> n)
if (n < hexdigits.size())
result += hexdigits[n];
cout << result << endl;
}
错误信息
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
No symbol table is loaded. Use the "file" command.
[New Thread 200.0x1030]
Quit (expect signal SIGINT when the program is resumed)