In this program, we are going to share how to find the length of a string program in c++ programming language with the output. If you are a beginner and want to start learning the c++ programming, then keep your close attention in this tutorial as I am going to share a C++ program to find the length of a string with the output.
Copy the below C++ program and execute it with the help of Turbo C compiler. At the end of this program, We have shared the output of this program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <iostream> #include <cstring> using namespace std; int main() { char str[] = "Freeweb Mentor"; cout << "String Length = " << strlen(str); return 0; } |
String Length = 14
Liked this program? Do Like & share with your friends.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: algorithm to find length of string, c++ program to reverse a string, c++ string length vs size, cpp program to find Length of String, how to find length of character array in c++, how to find length of string in c++ using strlen, strlen c++, word length c++