GeekInterview.com
Series: Subject: Topic:
Question: 15 of 267

Explain Base Class Pointer with an example

Asked by: Sweet Titly | Member Since Feb-2012 | Asked on: Feb 4th, 2012

View all questions by Sweet Titly

Showing Answers 1 - 1 of 1 Answers
nik

Answered On : Feb 22nd, 2012

Base class pointer with example

Code
  1. class A{};
  2. class B:public{};
  3. int main(){
  4. A* ptrA; //base class pointer
  5. //ptrA=new B();
  6. //or
  7. //ptrA =new A();
  8. return 0;
  9. }

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.