11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

148Part II: Becoming a Functional C++ ProgrammerTable 10-1Debugger Commands for MicrosoftVisual C++.NET and Dev-C++Command Visual C++ Dev-C++Start executing in debugger F5 F8Step in F11 Shift-F7Step over (Next Step) F10 F7Continue F5 Ctl-F7View variable Menu only Set breakpoint* Crl+B or click Ctl+F5Add watch Menu only F4Program reset Shift+F5 Ctl+Alt+F2*Clicking in the trough to the left of the C++ source code listing is an alternate way to set a breakpointin both environments.Running a test programThe best way to learn how to fix a program using the debugger is to gothrough the steps to fix a buggy program. The following program has severalproblems that need to be discovered and fixed. This version is found on theCD-ROM as Concatenate1.cpp.// Concatenate - concatenate two strings// with a “ - “ in the middle// (this version crashes)#include #include #include #include using namespace std;void stringEmUp(char* szTarget,char* szSource1,char* szSource2,int nLength);int main(int nNumberofArgs, char* pszArgs[]){cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!