+ 2
Creating a struct on the heap problem
what is the correct syntax for performing the operation? https://code.sololearn.com/c8H58JER1Bm6/#cpp
2 Answers
+ 2
There are other problems, but one is that you made a mistake declaring the pointer:
You did this:
languagePtr cpp = new LanguageStruct;
This is correct:
languagePtr *cpp = new LanguageStruct;
0
I used the typedef key word on the class so that syntax should be fine.