Finding out if a file has been striped or not

Is there a way in c to find out if a binary program contains debug information?
I have tried to compare the striped and unstriped versions of two programs,
but i have had a hard time understand them.

With some versions of Unix the "file" command will tell you. The "nm" command displays the symbol table from an executable, and a stripped executable will not have a symbol table.

Doing that inside the program could be interesting. Using Perderabo's suggestions would be easier.

If you are in an open source environment, donwload a copy of nm source for your system and see if you can use some of the routines it uses to find the symbol table entries.