Monday, March 10, 2014

How to Fix Microsoft Visual C++


1. Press the 'F5' key while in your Visual C++ application. This compiles and executes the code. The text box at the bottom of your screen shows you the syntax error, if one is found, and gives you its line number.
2. Double-click the line number in th bottom-right side of the screen. Enter the line number noted in Step 1. This brings you directly to the syntax error. Identify the error, fix the code, click 'Save' and press 'F5' again. The application runs normally.
3. Right-click a line number in your code and select 'Set Breakpoint.' This sets a break point, which means the debugger runs and stops at this line of code. Press 'F5' to run your code to this breakpoint.
4. Hover the mouse pointer over the variable on this breakpoint. This shows you the value of the variable. It also helps identify where in the code the variable is being set incorrectly. For example, your software is supposed to calculate '2 + 2' and you expect to see a return value of '4,' but when you hover the mouse over the variable you get a value of '0'--a logic error occurs because the return value is not what is expected.
5. Press the 'F10' key until you find the logic error in the code. The 'F10' key steps through the code line-by-line, so you can identify where the logic error is located. Change the code to remedy the logic error, click 'Save' and press 'F5' again to view the fixed application.

No comments:

Post a Comment