[Pyrex] Interpreting error messages

Joseph Koshy jkoshy at FreeBSD.ORG
Sun Apr 27 20:29:44 CEST 2003


> #include <stdio.h>

You'll need to import the right symbols from <stdio.h>.  The 
following program compiles.

    ----
    cdef extern from "stdio.h":
      char *malloc(int x)
      int sprintf(char *s, ...)

    cdef tostring(void *p):
      cdef char *s
      s = malloc(50*sizeof(char))
      sprintf(s, "%p", p)
      return s
    ----

Regards,
Koshy
<jkoshy at freebsd.org>




More information about the Pyrex mailing list