编程:输入目录,然后显示目录下的文件信息,该如何解决

编程:输入目录,然后显示目录下的文件信息
如题所示:输入目录,然后显示目录下的文件信息
用C或C++编写
请各位大虾多多指教,谢谢

------解决方案--------------------
DEV C++, 利用链表实现目录内所有文件列表显示

#include <stdio.h>
#include <dirent.h>
#include <string.h>

void main(int argc,char *argv[])
{
DIR *directory_pointer;
struct dirent *entry;
char path[80];
struct FileList
{
char filename[64];
struct FileList *next;
}start,*node;
puts( "Input the directory: ");
gets(path);
if ((directory_pointer=opendir(path))==NULL)
printf( "Error opening %s\n ",path);
else
{
start.next=NULL;
node=&start;
while ((entry=readdir(directory_pointer))!=NULL)
{
node-> next=(struct FileList *)malloc(sizeof(struct FileList));
node=node-> next;
strcpy(node-> filename,entry-> d_name);
node-> next=NULL;
}
closedir(directory_pointer);
node=start.next;
while(node)
{
printf( "%s\n ",node-> filename);
node=node-> next;
}
}
}
------解决方案--------------------
VC++遍历目录:
http://www.chinaitpower.com/A200508/2005-08-07/185546.html