I have some code I need to convert from Python to C++. Since I do not know C++ well, I would like to use this example to help me understand how a Python class relates/can be converted to a C++ class.
Given the following Python code:
class MyClass(object):
# Constructor
def __init__(self, arg1, arg2=True):
self.Arg1 = arg1
self.Arg2 = arg2
# Function __my_func__
def __my_func__(self, arg3):
return arg3
What would a proper translation to C++ be?
I've been trying to teach myself how to do this with the tutorial on cplusplus.com, but I still don't understand how I can relate this to Python.
I've also seen some SO questions asking how to convert a Python program to C++ (e.g. Convert Python program to C/C++ code?), but most answers suggest using a specific tool like Cython to do the converting (my desire is to do it by hand).