Display the maximum string length. - C++ STL

C++ examples for STL:string

Description

Display the maximum string length.

Demo Code

#include <iostream>
#include <string>
using namespace std;
int main()//from  ww w . j av a2s .  co  m
{
   string str1("Alpha");
   string str2("Beta");
   string str3("Gamma");
   string str4;
   cout << "The maximum string length is: " << str1.max_size()  << "\n\n";
   return 0;
}

Result


Related Tutorials