One error (though not the one that immediately got you, it seems) is this line: exit 1;. In C, exit is a regular ...
stackoverflow.com