All pastes #63617 Raw Edit

Untitled

public text v1 · immutable
#63617 ·published 2006-06-10 11:14 UTC
rendered paste body
#include <dirent.h>
#include <stdio.h>
#include <string.h>

main(void)
{
char (*a)[20][80];
int i;
//a = (char (*)[80]) malloc(sizeof(*a) * 20);
DIR *d;
struct dirent *dir;
d = opendir("/mnt/G:");

if (d)
{
  while ((dir = readdir(d)))
  {
for(i = 0; i < 10; i++)
{
 a[i] = dir->d_name;
}
  }
  closedir(d);
}
for(i = 0; i < 20; i++)
{
 printf("%s\n" , a[i]);
}

}