Is it possible to write a method which accepts dot notation from system objects?
for example, is it possible to write soething liek this:
where method is not defined is string.h?Code:string str; str.method(args){ statements; }
Is it possible to write a method which accepts dot notation from system objects?
for example, is it possible to write soething liek this:
where method is not defined is string.h?Code:string str; str.method(args){ statements; }
I donīt think so. Why would you need such thing?
No, you cannot. What is included in a class is fixed. What you might be able to do, however, is create a derived class that adds the new method that you want added.
Code:class MyDerivedString : public string { public: void method(); }; void MyDerivedString::method() { cout << "method() has been called" << std::endl; }
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.