#include <iostream>
#include <string>
int main() {
std::cout << "Enter a line of text: " << std::endl;
std::string inputLine;
std::getline(std::cin, inputLine);//take input from user and put it into inputLine
std::string var = "1234567890123456789012345678901234567890";
//-----------------------------------------------vvvvv----------->use size member function of std::string
std::cout << "Length of string is: " << inputLine.size() << std::endl;
if (inputLine.size() > var.size()) {
std::cout << "Error, your line must be less than 40 characters" << std::endl;
}
else
{
std::cout<<"valid input"<<std::endl;
}
}