Try to install pm-utils. look here
Depend on your Linux, you better use yum, apt-get, etc...
Then it would be something like: system("pm-hibernate")
or system("pm-suspend")
Maybe you'll need to use a full path to the utility.
It is open source, so if you want to program it with c, open the sources and check how it done.
EDIT:
A c solution is to use d-bus look here
it is a c source code, check how the dbus-send.c (in the tools dir) is working (with the arguments below).
Build all, and all you need is to link with the libdbus.
cpmmand line to dbus-send tool:
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend \
int32:0