0
Challenge 1 question 3 makes no sense.
It took me HOURS to find a diff. solution to call a function using arrow syntax in the final line of code. myPtr -> foo(); Is the canned answer. It took me a while to figure out since Xcode. VS 2017. Dev c++. Not a single one accepted the line of code with error: This declaration has no storage class or type specifier Either the question is archaic as in older compilers may take the solution/the answer is incorrect. If the solution does work for you outside of the challenge please post the entire code.
2 odpowiedzi
+ 6
That's not true. If you create an object via pointer the arrow operator is the way to call it's methods.
It works just like in the question.
I guess you do some things wrong. To be able to explain your error you should post what you tried.
https://code.sololearn.com/cHFRsbHtaixw/?ref=app
+ 3
Doh.... sololearn tends to write blocks of code and not the entire working program meaning the libraries and namespaces are usually left unwritten. That’s what I should have paid more attention to.