View previous topic :: View next topic |
Author |
Message |
lightoze
Joined: 12 Feb 2006 Posts: 35
|
Posted: Mon Apr 03, 2006 11:05 am Post subject: String concatenation |
|
|
I have string1~string2=string1 error and suppose this is about memory managment and GC.
I call sys.linux.c.linux.readdir() function and it returns (dirent*). Then I use dirent.d_name string from this structure, and error cause may be in allocation issues (but using dirent.d_name.dup does not help). |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Mon Apr 03, 2006 1:37 pm Post subject: |
|
|
I don't understand. This code: Code: | import std.c.stdio;
void main()
{
char[] a = "abc".dup;
char[] b = "def".dup;
a = a ~ b;
printf( "?.*s\n?.*s\n", a, b );
} | prints
as expected, while Code: | import std.c.stdio;
void main()
{
char[] a = "abc".dup;
char[] b = "def".dup;
a ~ b = a;
printf( "?.*s\n?.*s\n", a, b );
} | doesn't compile. Can you give me some sample code that isn't behaving how you expect? |
|
Back to top |
|
|
lightoze
Joined: 12 Feb 2006 Posts: 35
|
Posted: Mon Apr 03, 2006 3:54 pm Post subject: |
|
|
I meant than "str1 ~ str2" gives str2 as result. I have tried to separate code, but it works when I do so. I'll try to debug concatenation in Ares runtime later. |
|
Back to top |
|
|
|