c++ - My length function in class -
i showed code you(c++), , have use my_len
function length.
how can my_len(?????)
. should write function parameter? should create constructor?
thanks lot.
header:
class string { public: .......... ......... int length(); private: ......... };
my codes:
int my_len(const char* p) { int c = 0; while (*p != '\0') { c++; p++; } return c; } int string::length() { my_len(?????); }
Comments
Post a Comment