Write a program To read all File from Current Directory

/*
    To read all File from Current Directory
*/
#include<iostream>
#include<dirent.h>
using namespace std;

int main()
{
    DIR *d;
    dirent *ptr;

    d=opendir("F:\\Project\\C++\\5 File Operations\\Encrypting File Data");

    while(readdir(d))
    {
        ptr=readdir(d);
        cout<<ptr->d_name<<endl;
    }
    return 0;
}

Previous
Next Post »