Q. Which of the following is the correct syntax to create a pointer to an object?

किसी ऑब्जेक्ट के लिए पॉइंटर बनाने के लिए निम्नलिखित में से कौन सा सही सिंटैक्स है?

A
ClassName *ptr = new ClassName();
B
ClassName ptr = new ClassName();
C
ClassName *ptr = ClassName();
D
ptr = new ClassName;

Explanation

Explanation will be available soon. Please stay tuned.

व्याख्या जल्द ही उपलब्ध होगी। कृपया बने रहें।

Invest in Future Achievers

Your support helps keep Exam Achiever 100% free for students preparing for exams.

Thanks for your support!

Comments

Leave a Comment