2012年5月25日

c++ using namespace std;

摘要: 一、先说<iostream.h>和<iostream>这两个被#include的预处理命令,它们是不一样的,它们其实是2个文件,两个文件的内容也是不一样的,.h的文件新的C++标准明确已经不支持了,新标准为了要使用namespace,同时也为了和C区别开。所以规定不使用.h后缀的文件。因此,当使用<iostream.h>时,相当于在c中调用库函数,使用的是全局命名空间,也就是早期的c++实现,当使... 阅读全文

posted @ 2012-05-25 15:29 D_D_U 阅读(1073) 评论(1) 推荐(0) 编辑

2012年5月18日

cc、gcc、g++、CC的区别

摘要: cc、gcc、g++、CC的区别 gcc是C编译器;g++是C++编译器;linux下cc一般是一个符号连接,指向gcc;gcc和g++都是GUN(组织)的编译器。而CC则一般是makefile里面的一个名字,即宏定义。因为Linux/Unix都是大小写敏感的系统,这点一定要注意。 cc是Unix系统的C Compiler,而gcc则是GNU Compiler Collection,GN... 阅读全文

posted @ 2012-05-18 10:52 D_D_U 阅读(772) 评论(0) 推荐(1) 编辑

2012年5月17日

linux 加./(点斜杠)和. /加(点空格斜杠)有什么分别?

摘要: ./(点斜杠)的意思是执行当前目录下的某可执行文件. . /(点空格斜杠)相当于 source 根目录下的一个脚本. source是用来执行脚本文件用的, 比如说 . ~/.bash_profile 会执行一遍~/.bash_profile 阅读全文

posted @ 2012-05-17 10:43 D_D_U 阅读(5441) 评论(0) 推荐(0) 编辑

2012年5月12日

快速提高 Vi/Vim 使用效率的原则与途径

摘要: 快速提高 Vi/Vim 使用效率的原则与途径 Vi/Vim 是所有 Unix/Linux 操作系统默认配备的编辑器。因其强大的功能和高效的操作,Vi/Vim 也成为众多 Unix/Linux 用户、管理员必须掌握并熟练使用的编辑工具之一。尤其是在没有图形界面的情况下,更是离不开 Vi/Vim。Vi/Vim 命令非常多、用法极为灵活,掌握起来有一定的难度。本文作者将结合自己的使用经验,分七个方面着... 阅读全文

posted @ 2012-05-12 16:40 D_D_U 阅读(873) 评论(0) 推荐(0) 编辑

2012年4月28日

Error Handling: Wrapper Functions

摘要: Error Handling: Wrapper Functions In any real-world program, it is essential to check every function call for an error return. In Figure 1.5, we check for errors from socket, inet_pton, connect, read,... 阅读全文

posted @ 2012-04-28 17:40 D_D_U 阅读(314) 评论(0) 推荐(0) 编辑

Host Names

摘要: Host Names Besides the standard numbers-and-dots notation for Internet addresses, you can also refer to a host by a symbolic name. The advantage of a symbolic name is that it is usually easier ... 阅读全文

posted @ 2012-04-28 11:07 D_D_U 阅读(294) 评论(0) 推荐(0) 编辑

Host Address Data Type

摘要: Host Address Data Type IPv4 Internet host addresses are represented in some contexts as integers (type uint32_t). In other contexts, the integer is packaged inside a structure of type struct in_a... 阅读全文

posted @ 2012-04-28 10:46 D_D_U 阅读(293) 评论(0) 推荐(0) 编辑

Byte Order Conversion

摘要: Byte Order Conversion Different kinds of computers use different conventions for the ordering of bytes within a word. Some computers put the most significant byte within a word first (this is ... 阅读全文

posted @ 2012-04-28 10:25 D_D_U 阅读(312) 评论(0) 推荐(0) 编辑

Socket Address Structures

摘要: Socket Address Structures Most socket functions require a pointer to a socket address structure as an argument. Each supported protocol suite defines its own socket address structure. The names of th... 阅读全文

posted @ 2012-04-28 10:11 D_D_U 阅读(266) 评论(0) 推荐(0) 编辑

Creating a Socket -----int socket (int namespace, int style, int protocol)

摘要: socket Function To perform network I/O, the first thing a process must do is call the socket function, specifying the type of communication protocol desired (TCP using IPv4, UDP using IPv6, Unix doma... 阅读全文

posted @ 2012-04-28 10:00 D_D_U 阅读(611) 评论(0) 推荐(0) 编辑

导航