# Printing the stack trace in C

**URL:** https://forum.kirupa.com/t/printing-the-stack-trace-in-c/281985
**Category:** Uncategorized
**Created:** [February 16, 2009, 12:58pm UTC](https://forum.kirupa.com/t/printing-the-stack-trace-in-c/281985 "2009-02-16T12:58:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)
#### Post date: [February 16, 2009, 12:58pm UTC](https://forum.kirupa.com/t/printing-the-stack-trace-in-c/281985/1 "2009-02-16T12:58:52Z")

</div>

Hi,  
does anyone know how or if it is possible to print the stack trace of a C programme when an error occurs ?

I have a print\_error() function that prints the appropriate error message when a programme encounters an error, and I’m trying to add some functionality to it… like printing the stack trace.

Anyone got any ideas / advice ?

thx
