
结论:上午考试越来越简单,但范围扩大,新知识点增多。
2、下午试题

结论:下午考试越来越实用,软件工程知识增多,体现出“系统设计师”的职责。
在写整型数据前,先转换一下:
i= htonl(i);
write_data(s, &i, sizeof(i));
在读整型数据后,再转变回来:
read_data(s, &i, sizeof(i));
i= ntohl(i);
示例
#include /* obligatory includes */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define PORT 3490
int main( int argc,char *argv[] )
{ int sockfd,nbytes; //套接字描述符、读入缓冲区的字节数
char buf[1024]; //缓冲区
struct hostent *he; //主机信息类型
struct sockaddr_in srvaddr;//Internet套接字结构
if ( (1) argc!=2 )
{ perror( "调用参数为零,请输入服务器的主机名!\n" ); exit(1);}
if ( (2) (he=gethostbyname(argv[1]))==NULL) //如果通过主机名没有获得对应的主机 信息就提示用户
|
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容 本站提醒:不要进行人身攻击。谢谢配合。 |