type casting errors in c