Feb 26, 2011 at 4:44pm UTC
Hello! I need to list the contents of a directory into an array..
I tried using readdir but it kept returning errors :S
1) can you give me some instruction on listing contents in a directory?
2) Is there a way to echo system commands into a variable/array?
thanks
EDIT
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <dirent.h>
...
int main () {
readdir("/home" );
...
return 0;
}
Last edited on Feb 26, 2011 at 4:53pm UTC
Feb 27, 2011 at 3:17am UTC
Im rusty on c/c++ so.. yeha :S
Feb 27, 2011 at 3:22am UTC
and i did read the man.. it isnt very clear though
Feb 27, 2011 at 12:41pm UTC
Last edited on Feb 27, 2011 at 12:43pm UTC
Feb 27, 2011 at 5:55pm UTC
hmmk sorry for my noobdulance :P I got it working :D