FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help: append a char* to a list of char* (a char[][])

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
bumbolol



Joined: 05 Jun 2010
Posts: 1

PostPosted: Sat Jun 05, 2010 7:45 am    Post subject: Help: append a char* to a list of char* (a char[][]) Reply with quote

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 Laughing

Regards.
Back to top
View user's profile Send private message
michaelp



Joined: 27 Jul 2008
Posts: 114

PostPosted: Sun Jun 06, 2010 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group