Dynamically-sized stack - follow up
First of all, bad naming.

Try prefixing everything with stack,  this makes it a bit more useful as a library where you won't name clash


stack_count
stack_top
stack_push
stack_pop
stack_is_empty


etc

A lot of stack implementations now don't let pop both return a value and change the stack.  It goes against CQS (Command Query Separation). Instead, just use top to get the the top of the stack, and pop simply removes one if one exists.

Your reallocs need to be tested to see if they work, if not, handle the situation nicely rather than the havoc that currently will happen.

Don't use fputs().  A stack should have no dependencies on a "UI"

you should have a stack_destroy  which free's up your stack memory.

Bad things will happen if your capacity increment is 1.

Having a multiplier as a capacity increment will make for a super expensive stack for larger amounts of memory.

Changing your elementcount-- then ++ again in peek is just weird.  Just change all this:

p-&gt;elementCount--;
int topValue = p-&gt;elementData[p-&gt;elementCount];
p-&gt;elementCount++;
return topValue;


to

return p-&gt;elementData[p-&gt;elementCount-1]