Answers for "print the value of char in c++"

C++
1

c++ get char of string

// string::at
#include <iostream>
#include <string>

int main ()
{
  std::string str ("Test string");
  for (unsigned i=0; i<str.length(); ++i)
  {
    std::cout << str.at(i);
  }
  return 0;
}
Posted by: Guest on October-28-2020

Browse Popular Code Answers by Language