i have this lib: #include <cstring.h>
why wont it work.Code:string message; length = strlen(message);
i have this lib: #include <cstring.h>
why wont it work.Code:string message; length = strlen(message);
1) length isn't defined any place.
2) message doesn't appear to be a valid string.
3) strlen uses character pointers, and 'message' is a class.*
*I might be off here, becuase they may have a different version of strlen in C++, but I don't believe so.
In short, your code is incomplete for me to be sure of exactly where your problem lies, but I believe #2 is your main problem.
Quzah.
Hope is the first step on the road to disappointment.
It won't work because you're using a c-style string function on a C++ string class. Either use char *message or call string::length() to retrieve the length.
For example...
string message = "Hello"
string::size_type length = message.length();
or
char *message = "Hello";
size_t length = strlen(message);