c基本知识
军光
这个作者很懒,什么都没留下…
展开
-
static
题目来自“C语言深度解剖”: 对static int j; void fun1() { static int i=0; i++; } void fun2() { j=0; j++; } void main() { int k=0; for(k=0;k { fun1(); fun2(); } }问i原创 2013-11-12 19:10:08 · 634 阅读 · 0 评论 -
指针问题
#include #include char *c[] = { "ENTER", "NEW", "POINT", "FIRST" }; char **cp[] = { c+3, c+2, c+1, c }; char ***cpp = cp; int main(void) { printf("%s", **++cpp); printf("%s原创 2014-03-26 15:06:05 · 362 阅读 · 0 评论 -
float在内存中存储
http://blog.csdn.net/yezhubenyue/article/details/7436624 浮点型变量在计算机内存中占用4字节(Byte),即32-bit。遵循IEEE-754格式标准。 一个浮点数由2部分组成:底数m 和 指数e。 ±mantissa × 2exponent (注意,公式中的mantissa 和转载 2014-03-26 12:34:59 · 483 阅读 · 0 评论 -
链表问题,逆序打印链表,改变链表指向方向
#include #include typedef struct TreeNode { int key; struct TreeNode* next; }Node,*ptrNode; //逆序打印链表 void ReversePrint(ptrNode phead) { if(phead==NULL) return; if(phead->next!原创 2014-06-04 15:45:44 · 596 阅读 · 0 评论 -
二维数组分配,释放空间
http://blog.csdn.net/xcyangfan/article/details/7055028 二维数组申请与释放 [cpp] view plaincopy int nGLen=10000;//Graph length int **test=new int* [nGLen]; for (int g=转载 2014-06-29 13:52:29 · 640 阅读 · 0 评论 -
重建二叉树
依据两个数组,前序遍历数组和中序遍历数组,建立二叉树原创 2014-06-11 23:39:25 · 334 阅读 · 0 评论 -
........
int KindNumOfApple(unsigned int m,unsigned int n) { if(m==1||n==1) return 1; if(m<n) return m; if(m>n) return KindNumOfApple(m,n-1)+KindNumOfApple(m-n,n); if(m==n) retu原创 2014-09-18 12:45:22 · 380 阅读 · 0 评论