#include <stdlib.h> needs to be added. The default data type for an undeclared function is int which will cause oddities like that. Always compile with -Wall when debugging stuff, as it will report such errors. -Brad Reinaldo Nolasco Sanches wrote: