I'm not sure.<div><br></div><div>Try __gshared string str = "a";<br><br><div class="gmail_quote">2011/10/1 Dainius (GreatEmerald) <span dir="ltr"><<a href="mailto:pastas4@gmail.com">pastas4@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">> However, this gets quite inefficient with a lot of different strings,<br>
<br>
</div>I just had an idea, perhaps it's possible to work around this<br>
particular point by creating a wrapper function that converts the<br>
passed variable into the C string type? The problem with this idea is<br>
that I can't find a way to pass the variable to begin with. Whenever I<br>
try to do that, D receives an empty string. My C code is this:<br>
<br>
    extern char* str;<br>
    printf("string is %s\n", getString(str));<br>
<br>
While the D code is this:<br>
<br>
    shared string str="a";<br>
    extern(C) immutable(char)* getString(string MyString)<br>
    {<br>
       writeln("Attempting to convert ", MyString);<br>
       return toStringz(MyString);<br>
    }<br>
<br>
This results in "Attempting to convert ", and not "Attempting to<br>
convert a", so obviously D is not getting the right data. But it<br>
doesn't segfault, either.<br>
</blockquote></div><br></div>