ちょっとだけべんりかも

#include <stdio.h>
#include <stdlib.h>

void argdump(int argc, char** argv){
  FILE* fp = fopen("params","w");
  int i;
  if(fp==NULL){
    fprintf(stderr,"file open error");
  }
  for(i=0; i<argc; i++){
    fprintf(fp,"argv[%d]: %s ",i,argv[i]);
  }
  fprintf(fp,"\n");
  fclose(fp);
}

int main(int argc, char** argv){
  argdump(argc,argv);
  return 0;
}
$ ./a.out hoge piyo
$ cat params
argv[0]: ./a.out argv[1]: hoge argv[2]: piyo