We can call static member function through both class name and objects...but we generally use class name to call static member function instead of objects....
Is there any performance benefit in it by using class name or is it just to remove confusion by not calling through object
SpS
34
Posting Pro
Recommended Answers
Jump to PostWell it seem I was wrong...
btw, no it will not be called through the object, it is only used for name resolution, only virtual functions will be called through virtual tables...
(try assembler output with your favorit compiler (gcc -O0 -c -S below)
sample output
(first …
All 4 Replies
perniciosus
19
Junior Poster in Training
jwenting
1,889
duckman
Team Colleague
perniciosus
19
Junior Poster in Training
SpS
commented:
Thanx
+1
SpS
34
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.