Program to Find length of String C++

This is a simple program to find Length of a String in C++.

Just traverse the string till NULL (‘’), increment the ‘i’ likewise.

Program to Find length of a String C++

using namespace std;

int main( )
    int i;
    char str[80];
    cout<<"Enter a string:";


    cout<<"Lenght of string is :"<<i;

    return 0;



length of string in C++

Leave a Comment