Suppose this code<br><br># getIstance return a long, that is a pointer to a in_addr struct<br>cdef in_addr tmp<br>tmpinPtr = in_.getIstance()<br>tmp = &lt;in_addr&gt;tmpinPtr[0]<br> <br># in this function gcc gives me an error<br>
func( tmp )<br><br>I take a pointer to a in_addr struct as a python long from the getIstance method. Then, I need to call a C function and pass a in_addr struct by value. With pyrex C the pyrex code compiles with no problems. But gcc gives me the error in mail&#39;s subject.<br>
<br>error: conversion to non-scalar type requested<br><br>How can I pass the structure by value deferencing a python long and casting it as the struct type I need?<br><br>(I&#39;ve wrote similiar code for function where I pass the structure by reference and there&#39;s no problems.)<br>
<br>