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 ......
1、C语言的项目内存管理很让人头疼,自始至终你要明白哪些内存应该要释放,哪些到最后才能释放,不然的话,就会出现一些堆被破坏的错误
2、每写一个函数一定要记得写它的测试程序,不管那个函数简单的还是复杂,不然的话,到最后会忙死你,有时还会犯一些低级的错误。这个教训我就犯过,写了一大堆Utility工具函数库,一个 ......
windows7 + ubuntu9.10双启动,这个有太多的帖子了,不过这次的情况比较复杂.
先装的WIN7,后装UBUNTU,没有任何问题.GRUB双启动.
后来因为一个情况,要装XP,把WIN7做了 ghost.装完XP,GRUB当然没有了,于是用ubuntu启动盘修复.
虽然启动菜单出来了,但只能进行ubuntu,进入windows的时候就提示error:cannot get C/H/S value ......
As is Known to us,the function Main is the entry point of all programs.Therefore, we are usually neglecting all that we don't do,which makes us not understanding it more clearly.Now there is a sample arm program which will provide something that opration system usually do.
asm:
&nb ......
C1X是C语言即C99标准之后将要推出的最新标准,了解到得原文如下:
C1X is the unofficial name of the planned new standard for the C programming language. It is intended to replace the existing C standard. This predecessor is informally known as C99. The standard is not yet fin ......