Answers for "type convert to char"

C++
1

string to char

string temp = "cat";
char * tab2 = new char [temp.length()+1];
strcpy (tab2, temp.c_str());
Posted by: Guest on October-29-2021
0

string to char

char c=s.charAt(0);//returns h.
Posted by: Guest on February-03-2022

Browse Popular Code Answers by Language