471,119 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

abstract class

Hi,

I am away from C++ for a while. I am a little bit confused here about [u]abstract classes --- If an abstract contains both pure virtual and nonvirtual methods, can it still be instantiated?

Thanks.

Cindy
Oct 9 '06 #1
2 2035
abstract class (here is the question again since there is a mistake in the original post.)
--------------------------------------------------------------------------------

Hi,

I am away from C++ for a while. I am a little bit confused here about abstract classes --- If an abstract class contains both pure virtual and nonvirtual methods, can it still be instantiated?

Thanks.

Cindy
Oct 9 '06 #2
Banfa
9,065 Expert Mod 8TB
An abstract class can never be instanciated.

A class is abstract if it has 1 or more pure virtual functions regardless of any other members.
Oct 9 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Tony Johansson | last post: by
12 posts views Thread by Daedalus.OS | last post: by
2 posts views Thread by Dave Veeneman | last post: by
6 posts views Thread by Dan Sikorsky | last post: by
7 posts views Thread by jason | last post: by
reply views Thread by mailforpr | last post: by
4 posts views Thread by N.RATNAKAR | last post: by
reply views Thread by emin.shopper | last post: by
4 posts views Thread by David Zha0 | last post: by
6 posts views Thread by Miguel Guedes | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.