Share via


How to find the error line

Question

Thursday, November 2, 2017 7:41 AM

I just use VS2015 and C++ two month approximately. I have a confusion about how to find the error lilne. If I'm in Matlab, it always locate the error line easily like this

The vs2015 sometimes tell me the line number, but it also often pop up a error windows like this

I have to say it have no any useful information for finding the error. In the meantime, the Call Stack cannot help a little either

Suppose I have two or more files, and every file have 500+ line code. If I get such error information, I don't know which line I should set a breakpoint. F10 have a low efficiency to find the error. Furthermore,even I enable the Just My Code,

F11 always step into those file which I don't care totally(those standard library but not write by myself). Do the visual studio have a fool  design or just due to I don't know how to use it? Save me, please.

All replies (1)

Friday, November 3, 2017 3:17 AM

Hi zhuyude,

Thanks for your posting.

To find out where the error occurs, you could ** "open the call stack** (Debug > Window > Call Stack) to see what functions are causing the problem. You can double click any line in the call stack to jump to the code and look at variable values from that method in the debugger. Search back up the stack until you find the last method in your code that the program was executing".

Reference link:

https://stackoverflow.com/questions/17123697/visual-studio-find-where-unhandled-exception-occurs-in-user-code

As for the unhandled exception pop-up, you could disable it in Exception Settings(Debug -> Windows -> Exception Settings), more info:

https://blogs.msdn.microsoft.com/devops/2015/02/23/the-new-exception-settings-window-in-visual-studio-2015/

 

Best regards,

Fletcher

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].