+ 5

[SOLVED]Why dose this give different pointer values?

in my C + + course I was learning about pointers. in this code when the person in the video runs the code, he gets the value 0x7fff5fbff808. but on my computer, i get the value 012FFCD4. and on sololearn i get a different value. is it because there ran on different compilers? https://code.sololearn.com/cXVSWyw0ZHPd/?ref=app

27th Sep 2018, 5:21 PM
LONGTIE👔
LONGTIE👔 - avatar
2 Answers
+ 12
That's the actual memory address the value is stored in at runtime. Even if you run the program 20 times on your PC, you'll most likely get 20 different outputs
27th Sep 2018, 5:55 PM
Anna
Anna - avatar
+ 1
there is one very minor problem also....you have initiated value of data member of class in the definition of class.....which give a sumentic error
28th Sep 2018, 1:35 PM
himanshu k
himanshu k - avatar