String Length C++ Stl Code Example


Example 1: length of string c++

// string::length #include <iostream> #include <string>  int main () {   std::string str ("Test string");   std::cout << "The size of str is " << str.length() << " bytes.\n";   return 0; }

Example 2: length of string in c++

str.length();

Example 3: create a string of length c++

#include <string> #include <iostream>  int main() {     std::string s(21, '*');      std::cout << s << std::endl;      return 0; }

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?