#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; }