+ 1

What is the answer in the speace

fill in the blanks to declare a class "test" with a "foo()" public member function. declare a pointer "my ptr" to "test" and call "foo()" via the pointer. class test { public: void foo () { ;{{ ____ my ptr = new test(); my ptr ___ foo();

4th Aug 2017, 3:32 PM
Nour Assoud
Nour Assoud - avatar
5 odpowiedzi
+ 7
Forgot the "*" Valentin ;). test* myptr = new test(); myptr->foo();
4th Aug 2017, 4:02 PM
Karl T.
Karl T. - avatar
+ 16
test* myptr = new test(); myptr->foo(); //Oops...^_^
4th Aug 2017, 3:41 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 5
Why do you ask? Was it in challenges?
6th Aug 2017, 7:13 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
Public test* ->
7th May 2020, 1:38 AM
Akshay Bharat Kumbhar
Akshay Bharat Kumbhar - avatar