Jan 28, 2001 #1 benaam Programmer Jan 11, 2001 20 US Hi How to convert from char arrays to strings? For eg: in my program I have declared as follwing: char c[20] = "hello"; String s; Now i want to get the value of c into s. How do I do that? Sample code would be useful Thanx in Advance
Hi How to convert from char arrays to strings? For eg: in my program I have declared as follwing: char c[20] = "hello"; String s; Now i want to get the value of c into s. How do I do that? Sample code would be useful Thanx in Advance
Jan 29, 2001 #2 aphrodita Programmer Dec 5, 2000 111 US for (int q=0;q<strlen(c);q++) s=s+c[q]; s=s+'\0'; Best Regards, aphrodita@mail.krovatka.ru {uiuc rules} http://www.hellforge.org Upvote 0 Downvote
for (int q=0;q<strlen(c);q++) s=s+c[q]; s=s+'\0'; Best Regards, aphrodita@mail.krovatka.ru {uiuc rules} http://www.hellforge.org