Skip to content

Tag: c++

parameter difference between C++ and Python

C++ Python I think their code should return same result however C ++ result is Python result is i don’t understand why variable’s address isn’t changed in Python while variable’s address is changed in C++ Answer i don’t understand why variable’s address isn’t changed …

c++ equivalent to python self.attribute = ObjectInstance()

i want to know if there is an equivalent way of doing this in c++: Answer self.b in C++ could be this->b, but also just b as this is implicit in C++. However, in C++, you have to declare (member) variables, while in Python you create them by assigning to them and the type of the variable is determinated by