Boost.Python by default includes functionality for wrapping Vectors. This makes it quite simple for exposing C++ std::vectors to Python. The following sample program will provide you a detailed understanding on how to achieve it!
Program to add the sum of integers in a vector.
When you build and run the above in the command Prompt using Python, you get the following output :
Program to add the sum of integers in a vector.
C++ program (SumOfVector.h)
When you build and run the above in the command Prompt using Python, you get the following output :
No comments:
Post a Comment