java - Calling static function on class in C++ -


this question has answer here:

i writing lot of java now, getting confused java static methods , c++ static functions.

in java, can call static methods class, , use/see it, exmaple:

public class a{     public void static b(){         system.out.println("hello");     } } 

you can do, a.b(); can in c++? if so, not popular compared doing in java?

you can that, in c++ using :: scope operator:

a::b(); 

and pointed out, if having instance a of class a in current scope can call a.b(). calling static method on instance confusing though, might want avoid it.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -