c++ - Simple way of returning the length of the string to output -
i writing program prints out user-entered string , length. able part:
#include <iostream> #include <string> using namespace std; int main() { string x; getline(cin, x); cout << "you entered: " << x << "string length/size is: "<< /* comes here ? */ <<endl; }
rest of process remains incomprehensible.
there's function belongs string object, in case x.length()
return length of string.
Comments
Post a Comment