The following profram is not compiled.
Why? Please help me!

//This is a file copy utility//

#include<stdio.h>
#include<conio.h>
main(int argc, char argv[])
{
  FILE *fs,*ft;
  char ch;
  if(argc!=3)
  {
    puts("Insufficient Arguments!");
    exit();
  }
  fs=fopen(argv[1],"r");
  if(fs==NULL)
  {
    puts("Cannot open Source file");
    exit();
  }
  ft=fopen(argv[2],"w");
  if(ft==NULL)
  {
    puts("Cannot open Source file");
    exit();
  }
  while(1)
  {
    ch=fgetc(fs);
    if(ch==EOF)
      break;
    else
      fputc(ch,ft);
  }
  fclose(fs);
  fclose(ft);
}
main(int argc, char argv[])

That should be:

int main(int argc, char *argv[]) //added [int] and *

Instead of exit() use return 0;

Your program will compile just fine now

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.