# How do I set up a method to find out where my cpp program has encountered a segmentation fault without using breakpoints.

How do I set up a method to find out where my cpp program has encountered a segmentation fault without using breakpoints.

##### Post Metadata
- Posted at: almost 6 years ago
- Net upvotes: 1


## Comments
### Comment 1

Breakpoints are great for stepping through your code line by line. If you need to find an exception, you need to add exception logging to your application. Then use Try/Catch logic to catch the exceptions and log them to a database, send an email, or some other logging method that you can use to go back and find out about the exception and what line of code caused it.

A google search for Try/Catch Exception handling will help you.

https://www.geeksforgeeks.org/exception-handling-c/

Additionally, you can find the segment fault in the stack trace. However it is common that your program will run without the fault locally, but experience it when released. Logging is paramount in assisting you in finding this.

##### Comment Metadata
- Posted at: over 5 years ago
- Author title: Digerati / Chief Technology Officer




## Related Product
[Visual Studio](https://www.g2.com/products/visual-studio/reviews)

## Related Category
[Java Integrated Development Environments (IDE)](https://www.g2.com/categories/java-integrated-development-environments-ide)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: about 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: about 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: about 13 years ago
  - Comments: 4


