Is this ok to do this ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is this ok to do this ?

struct stuff {string nom int age}; main typedef struct stuff stuff stuff *p = new stuff [n] I know this it's not a complete code but my question is can u make an object with a pointer? and then use dinámic memory?

19th Oct 2017, 9:59 PM
Efrain Ochoa
Efrain Ochoa - avatar
1 Answer
+ 2
Yes, you can. It is allowed. // If not, we couldn't use polymorphism as we do.
25th Oct 2017, 3:14 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar