Learn C, C++ Concepts
Hi, How can I create a file from diferent directory?I already tried with the full path, like this:fp = fopen( "\\dir1\\dir2\\ccplusplus.com", "wt" );Can anyone help me please?Thanks
Assuming you are running your program on Linux, here will be the code change that you should be using,fp = fopen( "/tmp/ccplusplus.com", "w" );or fp = fopen( "/tmp/ccplusplus.com", "w+" );in your code you have used,fp = fopen( "\\dir1\\dir2\\ccplusplus.com", "wt" );which seems to be a windows specific.Thank you
Hi,
ReplyDeleteHow can I create a file from diferent directory?
I already tried with the full path, like this:
fp = fopen( "\\dir1\\dir2\\ccplusplus.com", "wt" );
Can anyone help me please?
Thanks
Assuming you are running your program on Linux, here will be the code change that you should be using,
Deletefp = fopen( "/tmp/ccplusplus.com", "w" );
or fp = fopen( "/tmp/ccplusplus.com", "w+" );
in your code you have used,
fp = fopen( "\\dir1\\dir2\\ccplusplus.com", "wt" );
which seems to be a windows specific.
Thank you