c++ - What's the difference between using a.var and a.var() -


just example

class a{     public:      int a;     };  int main(){     test;     int b = test.a;     int c = test.a();   } 

my question when accessing member variable of class, there difference between using test.a , test.a()?

here test.a() call a function whereas test.a access object's public variable, both different things.

also, syntax incorrect should class instead of class.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -