我这个代码结果为什么老错
输出的第一个数是1,后边的就都是很大的负数
#include<iostream>
#include<cstdlib>
using namespace std;
class HugeInteger
{
public:
int b[5];
void print()
{
for (int i = 0; i < 5; i++)
{
cout << b[i]-48 << ' ';
}
}
};
int main()
{
HugeInteger *p = new HugeInteger[5];
char a[5];
for (int i=0; i < 5; i++)
{
cin >> a[i];
(p + i)->b[i] = a[i];
}
p ->print();
delete p;
p = NULL;
system("pause");
}