int elm = 0;
int size = 0;
array = newint [size];
// the array starts at array with value 1
// the array ends at array with value 5
for(int count=0; count<=5; count++)
elm+=1; size +=1;
delete  array;
// this prints the array
for(int new_count=1; new_count <=5; new_count++ )
cout<<"The array is: "<<array[new_count]<<endl;
line 8: why is size=0 if you want to save 5 elements in your array?
line 19: why do you increase size, it doesn't get used anymore
line 21: you know that you delete the dynamic array, before the loop is done, right?
lines24-end: since the array is already deleted, there is nothing to print
Line 8: its an n number of array so it does not matter how big it is i should have stated with 1
Line 19:because cause u dont know how many elements youll need could be 10 could be 1000
Line 21: this is the meat and bones the code works but im uneasy about this line maybe i could put it on another loop outside this one.
Line 24: it prints
Cause you dont know what the input is. it wont be necessarily be 1 to 5 array[elm] = all prime number in the world. Or array[elm]= fibanocci