PDA

View Full Version : gcc file operation



sree88
January 9th, 2012, 12:28 PM
hi all
i have to code to which has file operations.

i have got 2 issues

1. i want to get the file name from the user> append the file extension> and mention that file name in the fopen() command.

2. the file that i want to open is in a folder from where the C program is run.

ie if i have a file named 123.txt in a folder "jkl"
i ll get the name 123 from the user append .txt to the name and mention that name in
the fopen command.
i used the strcat() function to append, if the variable that holds the name is "fn", how can i mention it in the fopen command?

can u help me doin this??

nothingspecial
January 9th, 2012, 02:53 PM
One thread per question please.

Closed.