How to list all files in harddisk

cd \
dir /s

:)

How do you want the files? Name only or with path. What os are you using?

i need c++ code to list all files in windows platform.......

second thing...i need to store all the information abt files along with path into temporary file

The (by far) easiest way to do this is really:

int main()
{
    system("cd\\");
    system("dir /s > temp.txt");
}

and all the details are in temp.txt. :)

But if you want to do it the right way, you might want to look at FindFirst() and FindNext().

along with findfrst and findnext method suggested by Niek use recursion to get list of all files from harddisk