When I am using the sizeof(string_name) whatever I input, the value turns to be 4.When I include the string header file, strlen(string_name) is reported undeclared by the compiler.
1 2 3 4 5 6 7 8 9 10 11 12 13
#include<iostream>
#include<string>
usingnamespace std;
int main()
{
string a="Manasijmnbmhjt nnnbffhhffdgdfgd";
string* b;
b = &a;
cout<<sizeof(a)<<endl;
cout<<strlen(a);
cout<<*b;
cin.get();
}