1
#include "stdafx.h"
#include "stdio.h"
int main(int argc, _TCHAR* argv[])
{
FILE *fp;
fp = fopen("/tmp/test.txt", "w");
fprintf(fp, "This is testing...\n");
fclose(fp);
return 0;
}
我是新來的Visual Studio,但聽說其C/C的真棒IDE ++我做了一些基本的C和它的工作非常細,現在我有一個項目做,我很認真地停留在這一點上我不能夠與打開和關閉文件的方式是C當我編譯此代碼它給我一個錯誤錯誤而使用文件的使用C在Visual Studio 2010 IDE
看到這些圖片
http://farm7.static.flickr.com/6092/6311309820_9c06ef4f0a.jpg
http://farm7.static.flickr.com/6221/6310789365_4298e416bd.jpg
調試輸出:::
'FredEx Challenge.exe': Loaded 'C:\Users\Anunay\Documents\Visual Studio 2010\Projects\FredEx Challenge\Debug\FredEx Challenge.exe', Symbols loaded.
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\dwmapi.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\clbcatq.dll', Cannot find or open the PDB file
'FredEx Challenge.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file
FredEx Challenge.exe has triggered a breakpoint
幫助我,我是開往危機
當您在Visual Studio中創建項目時,您選擇了哪種類型?從發佈代碼的外觀上看,一個簡單的「Win32控制檯應用程序」是正確的。 – Blastfurnace
你認爲「/tmp/test.txt」是什麼意思在Windows上? –