|
[招聘][悬赏十万]擎天软件公司招聘安全研究工程师(悬赏十万)(无视学历、年龄、性别,可专职、兼职、外包)
潜力贴留名.Opera插图补丁.颜色补丁.字数补丁.. |
|
[转帖]微软宣布引退Live Messenger,中国大陆除外
潜力贴留名.Opera插图补丁.颜色补丁.字数补丁.. |
|
[原创]C语言学习总结之自定义栈模拟函数调用
俺来画蛇添足 #include <stdio.h> #include <malloc.h> #include <stdlib.h> //链式栈 typedef struct Node { int data; struct Node* pNext; }NODE,*PNODE; typedef struct Stack { PNODE pTop; PNODE pBottom; }STACK,*PSTACK; void init(PSTACK pStack); //初始化 void push(PSTACK pStack,int val); //压栈 void traverse(PSTACK pStack); //遍历 bool pop(PSTACK pStack,int* pVal);//出栈 bool isEmpty(PSTACK pStack); //栈空检测 void clear(PSTACK pStack); //清空 int main(void) { STACK s; int val=0; init(&s); //初始化一个空栈,因为此时栈顶等于栈底 push(&s,1); //压栈 push(&s,2); push(&s,3); push(&s,4); if (pop(&s,&val)) { printf("出栈元素值为:%d\n",val); } else { printf("pop出栈失败!"); } printf("遍历输出:"); traverse(&s); //遍历输出 clear(&s); printf("清空后输出:\n"); traverse(&s); return 0; } void clear(PSTACK pStack) { if (isEmpty(pStack)) { return ; } else { PNODE pTemp=NULL; while (pStack->pTop !=pStack->pBottom) { pTemp=pStack->pTop->pNext; free(pStack->pTop); pStack->pTop=pTemp; } } } bool isEmpty(PSTACK pStack) { if (pStack->pBottom==pStack->pTop) { return true; //空 } else { return false; } } bool pop(PSTACK pStack,int* pVal) //val接受出栈元素 { if (isEmpty(pStack)) { return false; //出栈失败 } else { PNODE pTemp = pStack->pTop; *pVal = pTemp->data; pStack->pTop = pTemp->pNext; free(pTemp); pTemp=NULL; return true; } } void traverse(PSTACK pStack) { if (isEmpty(pStack)) { printf("栈为空!\n"); return; } PNODE p=pStack->pTop; while (p!=pStack->pBottom) { printf("%d,",p->data); p=p->pNext; } printf("\n遍历完成!\n"); } void push(PSTACK pStack,int val) { PNODE pNew=(PNODE)malloc(sizeof(NODE)); pNew->data=val; pNew->pNext=pStack->pTop;//先将旧栈顶元素的地址保存到新元素的指针域 pStack->pTop=pNew; //将新元素标记为栈顶,这个就是新栈顶元素 return ; } void init(PSTACK pStack) { pStack->pTop=(PNODE)malloc(sizeof(NODE)); if (NULL==pStack->pTop) { printf("失败1!\n"); exit(-1); } else { pStack->pBottom=pStack->pTop; pStack->pTop->pNext=NULL; } } |
|
[讨论]好吧,也是巧了。截图留念
我没看懂 求教 |
|
直接阅读源码(尤其是汇编码)在屏幕上挺费眼的,你们有什么好办法? 有的打印在纸上面,有的抄写,有的IDAD
背景色调为220 220 220 会好点 |
|
[转帖]The KMPlayer v3.3.0.51 (aka 3.4.0.0)
还在用的版本是2.9.3 ,用了好几年,太好用啊 皮肤喜欢k-AMP5.ksf,简约而不简单,贴心舒心安心 音乐无国界,播放音乐的播放器也无国界,佩服这个棒子的作品,更新了这么多年! |
|
|
|
[调查]湖南或者长沙本地的朋友请来报个道,技术交流定期聚会搞搞活动啊
深海潜水艇浮出水面 |
|
|
|
[求助]突然断电了
占个楼先,一会儿再发表意见 |
|
[原创]Ordinary少年零基础易语言自学
学这个纯属浪费时间! |
|
[原创]代码着色器,开源
当然是10年后咯,不过我们希望早点 |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值