#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
#include <ctype.h>
int main(void)
{
short i = 0; char num; char mass[50] = {};
DIR *dir = opendir("/home/rivares1853/Desktop/34/21");
if(dir)
{
struct dirent *entry;
while((entry = readdir(dir)) != NULL)
{
if( *(entry->d_name) == ' . ' )
{
continue;
}
else
{
mass[i++] = *(entry->d_name);
printf("%s\n", entry->d_name);
}
}
}
else
{
fprintf(stderr, "Error opening directory\n");
}
closedir(dir);
printf("-----------------------\n");
short j = i;
for( i = 0; i < j; ++i)
{
printf("%s\n", &mass[i]);
}
return 0;
}
char mass[50]
mass[i++] = *(entry->d_name);
for( i = 0; i < j; ++i)
{
printf("%s\n", &mass[i]);
}