"); //-->
#include <stdio.h> #include <string.h> /* 小练习:就是打印./22 文件夹下 xx_1 xx_2 xx_3 三个文件*/ int find_file(unsigned char *path,int number) { unsigned char file_path[18]={0}; int i=0; strncpy(file_path,path,strlen(path)); strcat(file_path,"xx_"); printf("1 \n"); for(i = 0;i < number; i++) { file_path[strlen(path) + 3] = i + 0x30; file_path[strlen(path) + 3 + 1] = '\0'; printf("the file name is %s \n",file_path); } } int main (int argc , char **argv) { unsigned char path[18] = "./22/"; find_file(path,3); return 0; }
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。