Static and non static functions

A

Alejandro

Is it possible for a class to have a function available both as static
and as instance function?
 
C

Carl Daniel [VC++ MVP]

Alejandro said:
Is it possible for a class to have a function available both as static
and as instance function?

Yes, but the parameter lists have to be different (just like any set of
overloaded functions).

-cd
 
S

Saad Rehmani

Hello Alejandro,

Why do you want to have two different methods? Is there a difference in behavior
between them?

Saad
 
V

Vadym Stetsyak

Hello, Alejandro!

A> Is it possible for a class to have a function available both as static
A> and as instance function?

Compiler will not let you define twice or more methods with same name and same signature.
There will be compiler error...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top