Since stack is a struct stacker object, not a pointer, the -> notation is not correct. The warning about malloc() is because of a missing #include <stdlib.h>.