Re: Question about strings and pointers

Valentin Haenel <[email protected]>
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
* Valentin Haenel <[email protected]> [100220]:
> The trick i used is to specify the argument types of the c function as c_int
> instead of POINTER(c_char). I can then use 'addressof' to obtain the location in
> memory of the string (in fact a pointer to the first character of the string).
> Lastly i used multiples of sizeof(int) to index into the string_buffer.

Sorry, make that sizeof(c_char), not sizeof(int)

V-

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.