Hello,
When i compile the below given code i get error. But i am not sure as to why such error is coming?i am just trying to overload the strlen() function! Please give me the reason for it
Code:#include <string.h> #include <iostream.h> class set { char *a; public: set(){} set(char *b) { a=b; } int strlen() { return strlen(a); } }; int main(void) { clrscr(); char *p="abc"; set a(p); cout<<strlen(p)<<endl; cout<<a.strlen(); return 0; }