GNU C ANSI C 一些区别
1 可变数据结构
struct var_data
{
int len;
char data[0];
};
遍历len后数据
for(i = 0; i < s.len; i++)
{
printf("%02x",s.data[i]);
}
2 case 范围区间 【x,y】
3 语句表达
#define min_t (type, x, y) \
({ type __x = (x); type __y = (y); __x < __y ? __x: __y;})
int ia, ib, mini;
float fa, fb, minf;
mini = min_t ( int, ia, ib);
minf = min_f (float, fa, fb);
标准c:
#define min (x, y) ((x) < (y) ? (x) : (y))
代码min ( ++ia, ++ib) 被展开为 ((++ia) < (++ib) ? (++ia):(++ib)) ia,ib 被加了两次。
4 typeof
#define min(x, y) ( {\
const typeof(x) __x = (x); \
const typeof(y) __y = (y);\
(void) (&__x ==&__y); \
__x <_ _y ? __x : __y ;})
5 pr_debug 可防止在参数选项不代表任何参数的时候 不输出,。
6 可指定范围初始化数组 unsigned char data [MAX] = { [0 ... MAX - 2] = 0};
结构体成员初始化结构体:
struct file_operations ext2_file_operations =
{
llseek:generic_file_llseek,
read: generic_file_read,
}
同样,标准c:
struct file_operations ext2_file_opreations =
{
.llseek = generic_file_llseek,
.read = generic_file_read,
}
.....
相关文档:
参看www.pgsqldb.org网站上的文档/客户端编程
需要链接libpq库,应包含头文件include/libpq-fe.h
路径要看你具体将postgresql安装在哪里啦
给你一个具体例子吧(从www.pgsqldb.org上copy的)!!!
&nb ......
这两天,给自己电脑弄了双系统,除了原来的Windows 7系统外,装上了Linux系统,使用的版本是Ubuntu
(点
击可到相应的下载页面)。开始我装的Linux版本是fedora9,对于一个根本没接触过Linux系统的人而言,使用fedora,简直让人崩溃。更
崩溃的是,我用的英文版。没的办法,又重新下载Linux,刻碟。装系统。装系统的时候 ......
我们常说的左值lvalue和右值rvalue并不简单地意味着左右区别,它的原始定义如下:
Definition:
C and C++ have the notion of lvalues and rvalues associated with
variables and constants. The rvalue is the data value of the variable,
that is, what information it contains. The "r" in rvalue can ......
转载自:http://www.cnblogs.com/eddyshn/archive/2009/11/23/1608823.html
VC编译选项 多线程(/MT)
多线程调试(/MTd)
多线程 DLL (/MD)
多线程调试 DLL (/MDd)
C 运行时库   ......