View previous topic :: View next topic |
Author |
Message |
bumbolol
Joined: 05 Jun 2010 Posts: 1
|
Posted: Sat Jun 05, 2010 7:45 am Post subject: Help: append a char* to a list of char* (a char[][]) |
|
|
Here is my code:
Code: |
DIR* dir;
Dirent* entry;
char[][] list;
dir = opendir(path);
entry = readdir(dir);
while ( entry !is null ){
list ~= tango.stdc.string.strdup(entry.d_name.ptr);
entry = readdir(dir);
}
closedir(dir);
|
and the following error i get:
Quote: |
Error: cannot append type char* to type char[][]
|
Thanks in advance to the one who will correct this beginner stupid mistake of mine
Regards. |
|
Back to top |
|
|
michaelp
Joined: 27 Jul 2008 Posts: 114
|
Posted: Sun Jun 06, 2010 9:32 am Post subject: |
|
|
I think what you want is tango.stdc.stringz.fromStringz(char*) that returns a char[]. So...
Code: | list ~= tango.stdc.stringz.fromStringz(entry.d_name.ptr); |
|
|
Back to top |
|
|
|