Answers for "use of strlen in C++"

C++
0

use of strlen in C++

#include <iostream>
#include <cstring>
using namespace std;

int main() {

  // initialize C-string
  char song[] = "We Will Rock You!";

  // print the length of the song string
  cout << strlen(song);

  return 0;
}

// Output: 17
Posted by: Guest on September-02-2021

Browse Popular Code Answers by Language