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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -