请问一个关于socket编程的问题,函数:connect
函数:connect(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr)),在这个函数中的第一个参数sockfd明明是采用的传值而不是传指针也不是别名,为什么当连接成功后,sockfd的值会变??
[解决办法]
gdb:
watch sockfd
VC6:
From the Edit menu, click Breakpoints.
Click the Data tab of the Breakpoints dialog box.
In the Expression text box, type the name of the variable:sockfd
Click OK to set the breakpoint.