Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 210

Python ctypes return values question

$
0
0

Why if i have this simple code

void voidFunct() {      printf("voidFunct called!!!\n");}

I compile it as a dynamic library with

gcc -c LSB.c -o LSB.o gcc -shared -Wl -o libLSB.so.1 LSB.o 

And i call function from a python interpreter, using ctypes

>>> from ctypes import *>>> dll = CDLL("./libLSB.so.1")>>> return = dll.voidFunct()voidFunct called!!!>>> print return17

why the value returned from a void method is 17 and not None or similar? Thank you.


Viewing all articles
Browse latest Browse all 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>