![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: May 2006
Location: Bathroom
Posts: 43
Rep Power: 0
![]() |
How to call normal "write" function inside a class
simple problem but I cannot figure out how to solve it:
I have a class "Foo" which has a method "write(string str)". Inside this method I want to call the normal write function as defined in unistd.h: write(int fd, const void *buf, size_t count) I get the following compiler error: error: no matching function for call to ‘Foo::write(int&, const char*&, size_t) So the compiler (gcc 4.1) wants to call "Foo::write" instead of "write". How can I specify to call the normal write function? |
|
|
|
|
|
#2 |
|
Hobbyist
Join Date: Sep 2005
Posts: 266
Rep Power: 4
![]() |
Well, you could just change the name of your member function for one. And/or prefix the fuction call with :: which will resolve to global scope.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|