救救小弟把

各位大哥救救小弟把!
编一个程序,功能为:输入一个目录,显示该目录下所有文件和子目录的相关信息

------解决方案--------------------
啊弟呀,给点分吧
------解决方案--------------------
DEV C++, 利用链表实现目录内所有文件列表显示

/*#include <alloc.h> */
#include <stdio.h>
#include <dirent.h>
#include <string.h>

void main(int argc,char *argv[])
{
DIR *directory_pointer;
struct dirent *entry;
struct FileList
{
char filename[64];
struct FileList *next;
}start,*node;
char path[80];
puts( "Input the directoy: ");
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