0

why i get this?

Frist of all take a look at the following source code class A {}; int main (){ A a ; cout <<&a; /* some address will be appear but if i do it like this one */ A b() ; cout <<&b; // i get 1 ! why?

7th Mar 2017, 11:26 PM
Navid Tak
Navid Tak - avatar
1 Antwort
+ 1
You are getting 1 because you have written "A b();" instead of "A b;". You have declared a function "b()" instead of writing "b".
9th Mar 2017, 6:19 PM
Nazareth Haroutioun Keshishian
Nazareth Haroutioun Keshishian - avatar