The following code is available:
#include <iostream> #include "big_int.h" using namespace std; int main() { char *num = "124141414141444134"; big_int a; cout << (int)num[0] << endl; a = num; cout << a; } The problem is that the output (first cout ) is not the 0th character, i.e. 1 , and the number 49 ...
int, that is, not the symbol'1'but the numeric value of the constant'1'. And this is49on your platform. Remove the cast to(int)and the character'1'will be output. - AnT