C语言按关键字搜索文件夹中文件的方法

2020-01-06 13:21:15于海丽
  • #include<dir.h>  #define SIZE 12 
  • void find_creat_file(char *);  int main(void) 
  • {  char filename[SIZE]; 
  • strcpy(filename,"filename");  find_creat_file(filename); 
  • getch();  return 0; 
  • }  void find_creat_file(char *filename) 
  • {  struct ffblk ffblk; 
  • int done;  done=findfirst("d:filename",&ffblk,0); 
  • if(done==0)  return 0; 
  • else  mkdir("d:filename"); 
  • 希望本文所述对大家的C语言程序设计有所帮助。