473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

pure virtual fxn decl

Hi,
what does the assignment " = 0 "
signify in the pure virtual function declaration

virtual void f() = 0 ;

what gets the value "0" ?

regards,
Aman .
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Jul 19 '05 #1
4 1790
WW
A man wrote:
Hi,
what does the assignment " = 0 "
signify in the pure virtual function declaration

virtual void f() = 0 ;

what gets the value "0" ?


Nothing. Nul. Nil. Nada. Zip.

It means that we declare the function but will not (necessarily) give it a
body and derived classes are better off override it unless they are abstract
classes too.

--
WW aka Attila
Jul 19 '05 #2

"A man " <am**@techie.com> wrote in message news:80************************************@mygate .mailgate.org...
Hi,
what does the assignment " = 0 "
Equal signs immediately following declarations aren't assignments, it's an
initialization.
signify in the pure virtual function declaration

virtual void f() = 0 ;
It indicates the function is pure virtual. It's just a hack to use the initialization
sequence that wouldn't be valid anything to signify the difference between "pure
virutal" and just "virutal." The other option would be to add a keyword like "pure"
to the language, which people are reticent to do because adding keywords potentially
breaks existing programs that might have used that as an identifier. It's painful
enough dealing with new, delete, and class when moving stuff between C and C++.
what gets the value "0" ?


Nothing really.

Jul 19 '05 #3
Thank you !!
regards,
Aman.
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Jul 19 '05 #4

"A man " <am**@techie.com> wrote in message
news:80************************************@mygate .mailgate.org...
Hi,
what does the assignment " = 0 "
signify in the pure virtual function declaration

virtual void f() = 0 ;

what gets the value "0" ?


Nothing. It's just a rather poor way of saying that the function is pure
virtual.
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: santosh | last post by:
Hello, I was going through the Marshal Cline's C++ FAQ-Lite. I have a doubt regarding section 33.10. Here he is declaring a pure virtual destructor in the base class. And again defining...
37
by: WittyGuy | last post by:
Hi, I wonder the necessity of constructor and destructor in a Abstract Class? Is it really needed? ? Wg http://www.gotw.ca/resources/clcm.htm for info about ]
6
by: pakis | last post by:
I am having a problem of pure virtual function call in my project. Can anyone explaine me the causes of pure virtual function calls other than calling a virtual function in base class? Thanks
21
by: sks | last post by:
Hi , could anyone explain me why definition to a pure virtual function is allowed ?
10
by: John Goche | last post by:
Hello, page 202 of Symbian OS Explained by Jo Stichbury states "All virtual functions, public, protected or private, should be exported" then page 203 states "In the rare cases where a...
7
by: sam_cit | last post by:
Hi Everyone, I wanted to know as to what is the exact difference between a virtual function and a pure virtual function? Thanks in advance!!!
3
by: keith | last post by:
Dear mentors and gurus, I noticed at the end of section 22.4 of the 'FAQ-Lite' it says "Note that it is possible to provide a definition for a pure virtual function, but this usually confuses...
10
by: Rahul | last post by:
Hi, I tried to create a abstract class by having a non-virtual member function as pure, but i got a compilation error saying "only virtual member functions can be pure"... I'm trying to think...
14
by: Jack | last post by:
Hi, I meet a question with it , I did not get clear the different betteen them, for example: #include <iostream>
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.