Answers for "how to change char values in array in c++"

C++
3

c++ string to char array

const char *array = tmp.c_str(); //For const char array
char *array = &tmp[0]; // If you need to modify the array
Posted by: Guest on September-28-2020
1

c++ string to char array

std::string strCoffee = "Nescafe";
const char *charCoffee = strCoffee.c_str();
Posted by: Guest on October-14-2021

Browse Popular Code Answers by Language