#include
#include "fstream" #include
#include
#include
#include
using namespace std; string key="aabbccdd1122334455absacsafasfasvsapocasppf123oawirpw"; int lenOfAllKey=256; int main(){ DIR * dir; struct dirent * ptr; char file_list[100][40]; int i=0; char srcFile1[1][100]; printf("111\n"); string rootdirPath = "/home/jyh/code/rc4加密/password/"; string string x,dirPath; dir = opendir((char *)rootdirPath.c_str()); //打開一個目錄 while((ptr = readdir(dir)) != NULL) //循環讀取目錄數據 { printf("d_name : %s\n", ptr->d_name); //輸出文件名 x=ptr->d_name; dirPath = rootdirPath + x; //printf("d_name : %s\n", dirPath.c_str()); //輸出文件絕對路徑 // x = dirPath.c_str(); strcpy(srcFile1[i],dirPath.c_str()); //存儲到數組 if ( ++i>=100 ) break; } printf("111\n"); closedir(dir);//關閉目錄指針 }