I have a file copy program that takes from one file and pastes in another file pointer. But, instead of getting targetname from user input i’d like to just add a ‘1’ at the end of the input filename and save. So, I tried something like this…
.... header & inits ....
fp=fopen(argv[1],"r");
fq=fopen(argv[1].'1',"w");
.... file copy code ....
Yeah it seems stupid but I’m a beginner and need some help, do respond soon. Thanks 😀
P.S. Want it in pure C. I believe the dot operator can work in C++.. or atleast i think.. hmm
One more thing, i’m already aware of strcat function.. If i use it, then i’ll have to define the size in the array… hmm. is there no way to do it like fopen(argv[1]+”extra”,”w”)
1 Answer