0
C++ printing object “names”
I want to print my object’s name. I wrote “cout << obj -> name << “‘s” << “points: “ << obj -> points << endl;” Which is something that has worked many times before. But now, it prints out “ ‘s points: *address of points*”. So the name is blank. I have no errors, but it prints out nothing. I think I know why it is printing the address of points and not the actual poinsettia because I wanted that to happen, but why does it not print anything where the name is supposed to be? Am I missing something really simple? Thanks for any help :)
7 odpowiedzi
+ 4
Can you attach the code in which you are facing the problem
+ 2
edit this question by tapping the three dots on the right side then you will see + symbol tap it and add your code
0
Ok, how do I do that?
0
Oh I noticed it says “poinsietta” instead of pointer. I think my keyboard was set to spanish haha
0
It only works with code from Sololearn, I think, and I wrote this on Visual Studio. So I dont think I can upload it. I didnt see an option for it at least
0
copy paste it on sololearn's c++
0
Or just use pastebin.