Hi all,
I'm a newbie to Visual C++ (and C++ in general), and first I'd like to say thanks -- I had multiple problems with my first program running correctly, and found most of the answers here, in previous threads.
I did get it running, but now I have a question about the debugger.
Like daman above, I am teaching myself using Prata's C++ Primer Plus and tried one of those "carrots" programs like the one above.
When I ran the debugger on the program after I got all the aforementioned problems fixed, the program would start fine but dump me back out when I input a number. Output from the debugger is below, but what really confuses me is that when I clean the program and start it without debugging, it runs just fine. In addition, I can only get it to run from inside VC without debugging -- the executable that's created does the same thing as the debugged version (ie crashes).
I'm using a Win32 console rather than the Windows subsystem, so that doesn't seem to be the problem. My build log is massive compared to daman's, but I included the info below.
Thanks in advance for your help and patience. 
The Output from the debugger:
'carrots_try3.exe': Loaded 'D:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\debug\carrots_try3.exe', Symbols loaded.
'carrots_try3.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Cannot find or open a required DBG file.
'carrots_try3.exe': Loaded 'C:\WINNT\system32\msvcr80d.dll', No symbols loaded.
'carrots_try3.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', No symbols loaded.
'carrots_try3.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Cannot find or open a required DBG file.
'carrots_try3.exe': Loaded 'C:\WINNT\system32\msvcp80d.dll', No symbols loaded.
The program '[1952] carrots_try3.exe: Native' has exited with code 0 (0x0).
LOG:
| | | Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004516842352.rsp" with contents [ /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\carrots_try3.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP ".\carrots_try3.cpp" ] Creating command line "cl.exe @"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004516842352.rsp" /nologo /errorReport:prompt" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004616842352.rsp" with contents [ /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Yc"stdafx.h" /Fp"Debug\carrots_try3.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP ".\stdafx.cpp" ] Creating command line "cl.exe @"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004616842352.rsp" /nologo /errorReport:prompt" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\TMP00004716842352.tmp" with contents [ 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\carrots_try3.exe.embed.manifest" ] Creating command line "rc.exe /fo".\Debug\carrots_try3.exe.embed.manifest.res" "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\TMP00004716842352.tmp"" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004816842352.rsp" with contents [ /OUT:"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\Debug\carrots_try3.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\carrots_try3.exe.intermediate.manifest" /DEBUG /PDB:"d:\program files\microsoft platform sdk\bin\carrots_try3\debug\carrots_try3.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 kernel32.lib ".\debug\stdafx.obj" ".\debug\carrots_try3.obj" ".\Debug\carrots_try3.exe.embed.manifest.res" ] Creating command line "link.exe @"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004816842352.rsp" /NOLOGO /ERRORREPORT:PROMPT" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004916842352.rsp" with contents [ /out:".\debug\carrots_try3.exe.embed.manifest" /notify_update /manifest ".\debug\carrots_try3.exe.intermediate.manifest" ] Creating command line "mt.exe @"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004916842352.rsp" /nologo" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\BAT00004A16842352.bat" with contents [ @echo Manifest resource last updated at %TIME% on %DATE% > ".\debug\mt.dep" ] Creating command line """d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\BAT00004A16842352.bat""" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\TMP00004B16842352.tmp" with contents [ 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\carrots_try3.exe.embed.manifest" ] Creating command line "rc.exe /fo".\Debug\carrots_try3.exe.embed.manifest.res" "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\TMP00004B16842352.tmp"" Creating temporary file "d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004C16842352.rsp" with contents [ /OUT:"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\Debug\carrots_try3.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\carrots_try3.exe.intermediate.manifest" /DEBUG /PDB:"d:\program files\microsoft platform sdk\bin\carrots_try3\debug\carrots_try3.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 kernel32.lib ".\debug\stdafx.obj" ".\debug\carrots_try3.obj" ".\Debug\carrots_try3.exe.embed.manifest.res" ] Creating command line "link.exe @"d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\RSP00004C16842352.rsp" /NOLOGO /ERRORREPORT:PROMPT" |
| | | Compiling... stdafx.cpp Compiling... carrots_try3.cpp Compiling manifest to resources... Linking... LINK : d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\Debug\carrots_try3.exe not found or not built by the last incremental link; performing full link LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup' Embedding manifest... |
| | | Build log was saved at "file://d:\Program Files\Microsoft Platform SDK\Bin\carrots_try3\carrots_try3\Debug\BuildLog.htm" carrots_try3 - 0 error(s), 1 warning(s) |