I’m trying to speed up a python routine by writing it in C++, then using it using ctypes or cython.
I’m brand new to c++. I’m using Microsoft Visual C++ Express as it’s free.
I plan to implement an expression tree, and a method to evaluate it in postfix order.
The problem I run into right away is:
class Node {
char *cargo;
Node left;
Node right;
};
I can’t declare left or right as Node types.
No, because the object would be infinitely large (because every
Nodehas as members two otherNodeobjects, which each have as members two otherNodeobjects, which each… well, you get the point).You can, however, have a pointer to the class type as a member variable: