|
-
May 31st, 2002, 12:26 PM
#1
virtual function
Can a virtual function be made static. An example would help
Thanks,
ruhail
-
May 31st, 2002, 12:44 PM
#2
about virtual
When u say function as virtual , the function should be used for
the derived class and as well as the class in which the function
is there. But when u say about 'static' it is only for particular
class. and it is class dependent. So static function cannot
be virtual.
Bye
manu
-
June 1st, 2002, 10:49 AM
#3
no!
as we all know, a "virtual" function is stored in the scope of its object as a function pointer(vptr), and so it's obvious that it cannot be a static one, for a static function must be stored out of the scope of objects so as to be referenced without the prefix of object name.
that's all what i know.
No one knows u r a doggy through Internet!
-
June 2nd, 2002, 07:57 PM
#4
Hi
NO! Virtual function can not be made static. Static functions or members are class lavel functions or variables and they are called independant of object.
-
June 3rd, 2002, 02:21 AM
#5
No.We can not make a virtual function as static .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|