07 2010 档案

内存对齐
摘要:首先看一个简单的程序:#include<stdio.h>void main(){ struct inner { char c1; double d; // char c2; }; printf("the size of struct inner is :%d\n",sizeof(struct inner));}在Ubuntu10.04下用gcc编译输出结果为:the size of s... 阅读全文

posted @ 2010-07-29 19:31 生活费 阅读(222) 评论(0) 推荐(0) 编辑

几个小程序
摘要:1、递归实现字符串的逆序打印#include<stdio.h>#include<string.h>void reserve(char *p){ if(*p=='\0')return; reserve(p+1); printf("%c",*p);}void main(){ char a[10]="abc"; reserve(a); printf("\n");}2、A,B,C,... 阅读全文

posted @ 2010-07-29 13:54 生活费 阅读(413) 评论(0) 推荐(0) 编辑

导航