[C++-sig] Fwd: passing pointers from python
hitesh dhiman
hitesh.dhiman.1988 at gmail.com
Fri Mar 19 03:56:42 CET 2010
---------- Forwarded message ----------
From: hitesh dhiman <hitesh.dhiman.1988 at gmail.com>
Date: Thu, Mar 18, 2010 at 11:39 AM
Subject: passing pointers from python
To: Development of Python/C++ integration <cplusplus-sig at python.org>,
boost-users at lists.boost.org
Hi all,
i'm trying to wrap c++ functions that have pointer variables. The test
example i'm using is shown below:
int World::addition(int* a, int* b)
{
int z = *a + *b;
return z;
}
Now, i defined it in my wrapper as :
.def("addition", &World::addition)
My code compiles, but when I try to execute it from python, i get this
error:
Python Argument types in World.Addition(World, int, int) did not match C++
signature: addition(class World {lvalue}, int* , int*)
Is there a workaround for this??
--
Regards,
Hitesh Dhiman
Electrical Engineering
National University of Singapore
--
Regards,
Hitesh Dhiman
Electrical Engineering
National University of Singapore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20100319/a95dbe81/attachment-0001.html>
More information about the Cplusplus-sig
mailing list