+ 2

Creating a struct on the heap problem

what is the correct syntax for performing the operation? https://code.sololearn.com/c8H58JER1Bm6/#cpp

22nd Jan 2018, 9:05 PM
Logomonic Learning
Logomonic Learning - avatar
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;
22nd Jan 2018, 9:35 PM
Jacob Pembleton
Jacob Pembleton - avatar
0
I used the typedef key word on the class so that syntax should be fine.
22nd Jan 2018, 9:47 PM
Logomonic Learning
Logomonic Learning - avatar