I.T. Discussion Community!
-Collapse +Expand
C++
Search C++ Group:

Advanced
-Collapse +Expand C++ To/From
To/FromCODEGuides
-Collapse +Expand C++ Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C++ Store
PRESTWOODSTORE

Prestwood eMagazine

May Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingC++Standard C++C++ OOP   Print This     
 
C++ OOP:
C++ Abstraction (=0 in a virtual method)
 
Posted 11 years ago on 10/23/2008 and updated 1/21/2009
C++ Code Snippet:
 A flashcard from our C++ Flashcards Library
 A code snippet from our C++ Code Snippets Page
 Tags: C++ , Abstraction

KB101345



General Info: Abstract Class / Abstract Member

An abstract class member is a member that is specified in a class but not implemented. Classes that inherit from the class will have to implement the abstract member. Abstract members are a technique for ensuring a common interface with descendant classes. An abstract class is a class you cannot instantiate. A pure abstract class is a class with only abstract members.

Languages Focus: Abstraction

Abstraction is supported at various levels with each language. A language could enforce abstraction at the class level (either enforcing a no-instantiation rule or a only abstract members rule), and with class members (member methods and/or properties).

C++ Abstraction

AbstractMemberFunction is a pure virtual function makes this class Abstract class indicated by the "=0"and NonAbstractMemberFunction1 is a virtual function.

Syntax Example:
class AbstractClass {
public:
virtual void AbstractMemberFunction() = 0;
  virtual void NonAbstractMemberFunction1();

};

Summary

Abstraction is an important aspect of your software design. To learn more about how abstract classes are similar concepts to interfaces, how they relate to Plato's Forms theory, and more, read our Abstract Members / Class definition article next.

More Info

Definition:  Abstract Class / Abstract Member

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1261A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101345 Counter
6977
Since 10/23/2008
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech