SWIG + print value of pointer

J

Java and Swing

I am using SWIG to wrap a C application for use in Python.

C code
======
// returns a pointer to an array of long values in the string, "input"
// MY_DIGIT is a typedef such as, typedef unsigned long MY_DIGIT;
MY_DIGIT *Split(char *input) { ... }

...I build a DLL named, _MyApp.dll

SWIG interface
==============
%module MyApp
extern MY_DIGIT *Split(char *input, char *delimiters);

%include cpointer.i
%pointer_functions(MY_DIGIT, md_ptr);

Python
=============
....when I print "results" python.exe crashes

....any idea why it crashes? Why can't I print it? FYI, if it matters,
I do the same steps in the main method of my C code and there is no
problem.

thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top