D - from char* to char[]
- manfred toppoint.de (13/13) Sep 03 2003 Hello,
- Walter (6/18) Sep 03 2003 try:
- manfred toppoint.de (4/24) Sep 04 2003 Yes, that what i want.
Hello, int main() { char[] string; char *query = "Test"; printf("query = %s \n",query); string = *cast(char[]*)query; //how to cast ? //strcpy(string,cast(char[]*)query); printf("string = %.*s \n",string); printf("\n"); return 0; } When i start the programm the variable string didn't print "Test" . Manfred Hansen
Sep 03 2003
<manfred toppoint.de> wrote in message news:bj6mcg$2cnk$1 digitaldaemon.com...Hello, int main() { char[] string; char *query = "Test"; printf("query = %s \n",query); string = *cast(char[]*)query; //how to cast ? //strcpy(string,cast(char[]*)query); printf("string = %.*s \n",string); printf("\n"); return 0; } When i start the programm the variable string didn't print "Test" .try: import string; ... string = query[0..strlen(query)];
Sep 03 2003
Yes, that what i want. Thank you. Manfred In article <bj6ndl$2e47$3 digitaldaemon.com>, Walter says...<manfred toppoint.de> wrote in message news:bj6mcg$2cnk$1 digitaldaemon.com...Hello, int main() { char[] string; char *query = "Test"; printf("query = %s \n",query); string = *cast(char[]*)query; //how to cast ? //strcpy(string,cast(char[]*)query); printf("string = %.*s \n",string); printf("\n"); return 0; } When i start the programm the variable string didn't print "Test" .try: import string; ... string = query[0..strlen(query)];
Sep 04 2003