I am trying to compile this piece of code but for whatever reason it won't work. Can someone help me? I want to know how to use strlen() properly:
 #include<iostream>
 using namespace std;
 int main()
 {
    char buffer[80];
    cout << "Enter a string:";
    cin >> buffer;
    cout << strlen(buffer);
    return 0;
 }
I've tried using cin.getline(buffer, 80); but I get the same compile error issue.
My compiler says the error is this
error: strlen was not declared in this scope
 
     
     
     
     
     
    