Hi,
I am creating/opening a file using,
FILE *file = fopen(" C:\\ABC\\Poo.txt","w+");
if(file == NULL)
printf("un sucessful");
else
printf("sucessful");
I am able to create a file name poo.txt on C:\ABC folder.
Now I used,
#define PATH "C:\\ABC\\"
FILE *file = fopen(" PATH+Poo.txt","w+");
OR
#define PATH "C:\\ABC"
FILE *file = fopen(" PATH\\Poo.txt","w+");
if(file == NULL)
........
How can I use PATH constant with file name in fopen?
Help me out ASAP.
Thanks in advance.
|
Go4Expert Member
|
|
| 9Apr2010,15:05 | #2 |
|
I tried this in linux machine.We can do this .
You have to mention like the following , Code:
FILE *file=fopen(PATH"/file.txt","r+"); |
|
Go4Expert Member
|
|
| 9Apr2010,15:07 | #3 |
|
Thank you so much for the reply.
|
