摘要:
Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe. The function returns a handle that can be used to access the file or device for var. 阅读全文
摘要:
在大多是的时候,大家都说一般情况下不要使用友元函数,因为它破坏了类的封装,但是有时候用友元函数也是一种不错的选择。1,当需要比较两个不同类的大小(肯定是比较类的一个成员变量),这个时候就需要用友元函数效率就比较高,代码如下:class B; //class B implementclass A{private: int x;public: A(int n) { x = n; } friend int check(A a, B b);};class B{private: int x;public: B(int n) { ... 阅读全文
摘要:
1,ioctlsocket()#include <winsock.h>This function controls the I/O mode of a socket.int ioctlsocket( SOCKET s, long cmd, u_long FAR* argp);Parameterss[in] Descriptor identifying a socket.cmd[in] Command to perform on socket s.argp[in, out] Pointer to a parameter for cmd.Return ValuesIf no error 阅读全文