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

java - unable show chart in xls document using jasper reports -

javascript - How to change image src on success AJAX -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -