are both syntax equal????

Dec 29, 2009 at 7:36pm
Hello everybody
i just want to know that
Are both the syntax equal



int *ptr=new int(10);

and
int *ptr=new int[10];



help would be appreciated..
Last edited on Dec 29, 2009 at 7:37pm
Dec 29, 2009 at 7:58pm
The former allocates an int initialized to 10, the latter allocates an array of 10 ints.
Topic archived. No new replies allowed.