Int *a=new int b; | Sololearn: Learn to code for FREE!


Int *a=new int b;

What does it indicate explain in a easy way

12/28/2018 9:37:01 AM

Jonny Walker

3 Answers

New Answer


Int *a=new int b; What does it indicate? It means you are trying to learn c++ and thus you are getting finest beating like everyone lol


int *a = new int b; Is a syntax error as: expected ',' or ';' before 'b' int *a = new int, b; Allocate memory for a single integer dynamically on the heap and returns its address to pointer `a`. Then declare another integer variable. int *a = new int[b]; Allocate memory for an array of integers of size `b` on the heap and returns the base address to pointer `a`.


AZTECCO I'm hungry! Loool