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

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -