CONCATENATE MANY FILES AND STORE THEM IN A FILE NAMED FILES USING C PROGRAM

#include"stdio.h" void concatenate(FILE *fp1,FILE *fp2,char *argv[],int argc); void main(int argc,char *argv[]) { FILE *fp1,*fp2; concatenate(fp1,fp2,argv,argc); getch(); } void concatenate(FILE *fp1,FILE *fp2,char **argv,int argc) { int i,ch; fp2=fopen("files","a"); for(i=1;i { fp1=fopen(argv[i],"r"); while((ch=getc(fp1))!=EOF) putc(ch,fp2); } }

1 comment:

Unknown said...

What will be output of the program? Explain .

#include
void fun(int);

int main()
{

int a=30;
printf("%d\n",a);
return 0;
}

void fun(int b)
{
b=60;
printf("%d\n",b);
}