/* File Copy using command line arguments */ #include<stdio.h> int main(int argc,char *argv[]) { FILE *fs,*ft; int ch; if(argc!=3) { printf("Invalide numbers of arguments."); return 1; } fs=fopen(argv[1],"r"); if(fs==NULL) { printf("Can't find the source file."); return 1; } ft=fopen(argv[2],"w"); if(ft==NULL) { printf("Can't open target file."); fclose(fs); return 1; } while(1) { ch=fgetc(fs); if (feof(fs)) break; fputc(ch,ft); } fclose(fs); fclose(ft); return 0; }
File Copy using command line arguments
Subscribe to:
Post Comments (Atom)
Very good!
ReplyDeleteInvalide numbers of argument
DeleteAttention everyone, the file provided above is not working. I have been looking for the working file and finally found it.
Delete✔️Click Here To Download http://gestyy.com/e0GAyS
✔️Click Here To Download
✔️Click Here To Download http://exe.io/XONVsO6l
✔️Click Here To Download
✔️Click Here To Download
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Mn.
..
.
.
.
..
.
.
.
.
.
.
.
.
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.zxzxzx
.sdcccxxx
step 1. put the code in file name " example.c"
Deletestep 2. compile the code file " example.c "
step 3. after compiling the code you get the " example.exe "
step 4. open turboc++ shell and find the location of the "example.exe or example.c"
step 5. make two txt file in one.txt file put same line of statements in my case i put the random statement "xyz"
step 6. after this above steps then put this command in turbox++ shell example.exe one.txt second.txt
step 7. now open the second.txt file your got the
"xyz"
Very good!
ReplyDelete-_-
ReplyDeletePlz can u explain me y u used a while(1).................i mean wat exactly is the condition over there?
ReplyDeletewhile(1) is used there for infinite loop. if eof is found then we are exiting loop here...
Deletefeof means end of file..
Deletewhen file ended break executes
this code is not working
ReplyDeletesuparrrrr
ReplyDeleteHow to execute this
ReplyDeletepls tell me the output
ReplyDeletePlzzzzz show its algorithm
ReplyDeletenice article for beginners.thank you.
ReplyDeletewelookups C++
javacodegeeks
What is the output??
ReplyDeleteoutput please
ReplyDeleteI am interested to buy your website if please contact for sell this is my website link here visit and click on contact or servers page you got my mobile number Features of C
ReplyDelete