Answers for "char to string c++"

C++
5

c++ cast char to string

// example
char sczName[] = {"Jakes"};
std::string strName = std::string(sczName);

/* SYNTAX
#include <string>
std::string(<char-to-convert>)
*/
Posted by: Guest on April-06-2020
4

char to string c++

std::cout << std::string(1, c) << std::endl;
Posted by: Guest on March-18-2020
3

why convert char* to string c++

char *cStr = "C++";
std::string Str = std::string(cStr);
Posted by: Guest on January-17-2021
1

c++ char to string

#include <iostream>
using namespace std;

int main()
{
  char c = 'l';
  string str;
  str.push_back(c);
}
Posted by: Guest on June-20-2020

Browse Popular Code Answers by Language