Program Discussion :: Strings
Home > Programs > Strings

74. Write an efficient program to find the length of a string.

Answer:

#include <iostream>

using namespace std;
int main()
{
    string str = "C++ Programming";
    /* you can also use str.length() */
    cout << "String Length = " << str.size();
    return 0;
}

Asked In ::

Post Your Answer Here:

Name *
Email

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: