Re: string to char* in betterC

2020-03-11 Thread 9il via Digitalmars-d-learn
On Wednesday, 11 March 2020 at 16:10:48 UTC, 9il wrote: On Wednesday, 11 March 2020 at 16:07:06 UTC, Abby wrote: What is the proper way to get char* from string which is used in c functions? toStringz does returns: /usr/include/dmd/phobos/std/array.d(965,49): Error: TypeInfo cannot be used

Re: string to char* in betterC

2020-03-11 Thread rikki cattermole via Digitalmars-d-learn
On 12/03/2020 5:07 AM, Abby wrote: What is the proper way to get char* from string which is used in c functions? toStringz does returns: /usr/include/dmd/phobos/std/array.d(965,49): Error: TypeInfo cannot be used with -betterC and I think string.ptr is not safe because it's not zero

Re: string to char* in betterC

2020-03-11 Thread 9il via Digitalmars-d-learn
On Wednesday, 11 March 2020 at 16:07:06 UTC, Abby wrote: What is the proper way to get char* from string which is used in c functions? toStringz does returns: /usr/include/dmd/phobos/std/array.d(965,49): Error: TypeInfo cannot be used with -betterC and I think string.ptr is not safe because

string to char* in betterC

2020-03-11 Thread Abby via Digitalmars-d-learn
What is the proper way to get char* from string which is used in c functions? toStringz does returns: /usr/include/dmd/phobos/std/array.d(965,49): Error: TypeInfo cannot be used with -betterC and I think string.ptr is not safe because it's not zero termined. So what should I do? realloc