GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 12-Dec-2004, 23:10
Poolan Poolan is offline
New Member
 
Join Date: Oct 2004
Posts: 19
Poolan is on a distinguished road

What does =0 in Pure virtual function means?


What does =0 in Pure virtual function means? IS there any specific purpose for that?

poolan
  #2  
Old 14-Dec-2004, 06:12
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,031
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
It means it is PURE virtual; this is it's only meaning; do you mean to ask what does Pure virtual function mean? If not, your question has been answered

Regards,
Luci
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #3  
Old 14-Dec-2004, 13:15
aaroncohn's Avatar
aaroncohn aaroncohn is offline
Regular Member
 
Join Date: Feb 2004
Location: Bay Area, CA.
Posts: 564
aaroncohn is a jewel in the roughaaroncohn is a jewel in the roughaaroncohn is a jewel in the rough
Using =0 in a function delcaration declares it as a pure virtual function. If you derive a class from a base class that has a pure virtual function in it, then you MUST write that function for the derived class.
__________________
-Aaron
  #4  
Old 26-May-2006, 05:46
alcoholic's Avatar
alcoholic alcoholic is offline
Member
 
Join Date: Nov 2005
Posts: 170
alcoholic is on a distinguished road

Re: What does =0 in Pure virtual function means?


Why not -1 or some other number?
__________________
Gravitation is not responsible for people falling in love.
-Albert Einstein
  #5  
Old 26-May-2006, 14:58
QED's Avatar
QED QED is offline
Member
 
Join Date: Feb 2005
Location: Hudson Valley, NY
Posts: 231
QED is a jewel in the roughQED is a jewel in the roughQED is a jewel in the rough

Re: What does =0 in Pure virtual function means?


Think of function declarations as pointers to the code that executes the body of the function. In fact, this is basically true at the object code level, as each class has a function table that contains pointers to the function code. (Inline expansion is an exception, I suppose.)

Hence, "pure virtual" implies a NULL pointer.

Matthew
__________________
I was born not knowing and have only had a little time to change that here and there. -- Richard P. Feynman

Boris Podolsky: James! How's the rat business?
James Moreland: Well, actually it's mostly students I'm experimenting on now.
Kurt Gödel: My God, the mazes must be enormous.
 
 

Recent GIDBlogNot selected for officer school by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 13:12
Why static member function cannot be virtual in C++ Poolan C++ Forum 1 20-Nov-2004 09:51
Nested for loop with function Tori C++ Forum 11 08-Nov-2004 13:02
Revising Script style ?????? pepee MySQL / PHP Forum 4 14-Apr-2004 04:59

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:45.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.