开发者

Problem with fopen and the windows console

I'm having a very strange problem. I'm using Visual Studio 2010 Ultimate on Windows 7 x64. I have this simple code:

#include <stdio.h&开发者_StackOverflow社区gt;

int main()
{
    fclose( fopen("hakuna", "w") );
    return 0;
}

It works very well when I compile it. When I go to the debug folder and double click on the exe it creates the file. But when I open the console and type in the destination of the exe and press "Enter" nothing happens. If there're some prinf-s they will appear, but the file is never created. I'll be very grateful if someone is able to help me. I really have no idea why this's happening


It's being created at your default directory - or wherever your cmdline active directory is.

For example, the cmdline will look like something like this.

C:\Users\Akari>

That's the directory where the file is being made.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜