using unix system calls in cpp
I am new开发者_如何学Python to cpp, I have a small problem, I have a cpp file and it contains open(), read() & close() & some other methods as public members. Now I wanted to use the 'read' unix system call in one of the methods But if I do so (in some method) its pointing to class member variable 'read()' and gives compilation error. So, how to use the unix system calls such as 'open, read, close' in the cpp? if not so any other alternative to use?
Thanks-opensid
If you are in a class that has a method read(), and you want to access a function read() in the global namespace, use ::read().
Try ::read(). The double colons take you to the top empty namespace.
精彩评论