What does this program do? I expected the program to encounter an error why we use new int ? is this correct to delete a ?
#include <iostream>
#include <iomanip>
#include <conio.h>
using namespace std;
#define null NULL
main()
{
int x;
int *a=NULL;
int *p;
int c=0,size=0,i;
while(cin>>x)
{
if(c>=size)
{
p=new int[size+3];
for(int i=0;i<size ;++i)
p[i]=a[i];
delete []a;
a=p;
size=size+3;
}
a[c++]=x;
}
}