Horje
string to char array c++ Code Example
string to char array c++
std::string myWord = "myWord";
char myArray[myWord.size()+1];//as 1 char space for null is also required
strcpy(myArray, myWord.c_str());
c++ string to char array
std::string strCoffee = "Nescafe";
const char *charCoffee = strCoffee.c_str();
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




8

Related
input a string in c++ Code Example input a string in c++ Code Example
conda list envs Code Example conda list envs Code Example
list conda environments Code Example list conda environments Code Example
remove element by index from vector c++ Code Example remove element by index from vector c++ Code Example
C++ try catch Code Example C++ try catch Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10