Python to C++ conversion substituting vectors for lists in a recursive function
__peter__ at web.de
Wed Mar 23 15:51:34 CET 2005
Your code has an undeclared int i in main().
I think erase() takes a pointer, not the element index:
> in the recursive function. Is my C++ translation accurate from the
> original Python?
Coming from a Python background, you should have learned that the proper way
to answer that question is to write a test suite.
Generally speaking, if you want to learn a new language it is probably
better to extend examples written in that language than to translate code
written in another language you are already familiar with. What is
idiomatic in one language may be clumsy and inefficient in another.
PS: Your post is off-topic in c.l.py, consider asking for further/better
advice in a C++ newsgroup.
More information about the Python-list