#include <Windows.h> #include <stdio.h> #include <tchar.h> #include <assert.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR ...
#include <Windows.h> #include <stdio.h> #include <tchar.h> #include <assert.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { fopen("Danny.txt","r+"); int res = GetLastError();//VS工具菜單-錯誤查找中獲取上一行代碼的錯誤原因。 assert(res == 2);//可以輸入條件表達式,但結果必須為真,為假則報錯。 if(res == 2) { OutputDebugString(L"res == 2");//在調試模式下,輸出視窗中顯示括弧內的字元串。 } //if(res == 0) //{ // TRACE(L"res的值為",res);//mfc環境在調試模式下,輸出視窗中顯示括弧內的字元串。 //} return 0; }