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上? –