December 23rd, 2004, 01:33 PM
Python assigning C/C++ f() ptrs
I'm very new to python programming. I've hacked together a few things, that's about it.
Here's my situation:
I have a C module that has a python wrapper. (This is code that was given to me.) I've modified the C code to expose some external function pointers.
I use C++ to implement the functions that these pointers point to.
I need to use python to assign the C++ functions to the C function pointers.
I've never really worked with three different programming languages like this before, so this is a little confusing for me.
December 24th, 2004, 02:27 PM
Actually there should only only be one language in play here since functions in C and C++ are the same, so unless your using objects somewhere in the C++ part you're probably better off in standard C. (I may be missing something here though.)
You might also want to ask this in the "C Programming" forum: http://forums.devshed.com/f42/s
Edit: If you want to see what the C guys think of the problem I can move/copy this thread for you .
As for assigning the pointer from within Python I don't think you can because the Python language doesn't support pointers/references directly – you'll probably need to do this via the C API but I haven't played around with this yet .
Have a good Xmas all,
Last edited by netytan; December 24th, 2004 at 02:33 PM.