Answers for "c++ single character from string"

C++
0

none

// string::operator[]
#include <iostream>
#include <string>

int main ()
{
  std::string str ("Test string");
  for (int i=0; i<str.length(); ++i)
  {
    std::cout << str[i];
  }
  return 0;
}
Posted by: Guest on January-01-1970
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

Code answers related to "c++ single character from string"

Browse Popular Code Answers by Language