I want to get a very large number from the user and put the each individual digits of that number in rows of an array, respectively. That's why I wrote this code in c++. But when I running code and copy that big number and paste in windows Cmd it only receives 4094 digits and does not allow to write more numbers. How to fix this?
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int size=0;
int *a=NULL;
int *b=NULL;
int count=0;
char x='0';
a=new int[size];
x=cin.get(); //input by user
while(isdigit(x)!=0)
{
if(count>=size)
{
b=new int[size+1];
for(int i=0;i<size;i++)
{
b[i]=a[i];
}
delete []a;
a=b;
size++;
}
a[count++]=x-'0';
x=cin.get(); //input by user
}
cout<<size;
}