How to find out which code is being executed

Is there a program or something else that can display which code is being executed while I'm running my program? I have a problem with my program where it doesn't "act" the right way and this is why I want to know which part of the code which is being executed when this happens this way I can figure out what's wrong.
What you're asking about is commonly known as a "debugger". You may already have one and you simply need to learn how to use it. Are you using an IDE? What compiler are you using? What operating system?
I'm using Visual studio but I do also have Codeblocks. My operating system is windows 10.
Visual studio comes with a debugger.

https://www.youtube.com/watch?v=C0vDKXIq_9A and many more
Topic archived. No new replies allowed.