FirstSearch Blue

Find Everything You Need On Your First Search

Article

C++ Convert String to Char Array

January 26, 2010 Updated February 19, 2017 1 min read fsb
Here is the best and simplest way to go from a string to an array of characters in C++ Example Code:

std::string myString = "My Name is Sam"; char *myCharArray = (char*)myString.c_str();

Conversation

Comments

Historic WordPress comments were imported into D1. New submissions stay in review until approved.

Published comments

Loading comments…