C++ examples for STL:string
Display the capacity of a string
#include <iostream> #include <string> using namespace std; int main()// www. j av a2s . co m { string str1("Alpha"); string str2("Beta"); string str3("Gamma"); string str4; cout << "Capacity of str1: " << str1.capacity() << "\n\n"; return 0; }