码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
linux内核中驱动开发常见的类似多态
#include #include struct test { char name[20]; void (*func)(char *); }; void tttfunc(char *name) { printf("current is %d\n",__LINE__); printf("%s\n",name); } int main() { struct test ttt= { .n...
分类:系统相关   时间:2014-05-22 11:25:09    阅读次数:380
c语言学习之结构篇代码示例-输入n个同学的姓名,数学英语成绩,按照平均分从低到高排序并输出
#include void main(){ const int count = 5;//定义数量 struct student{ char name[80]; float math,eng; float aver; }stu[count],temp; //输入 for (int i = 0; i scanf("%s%f%f", stu[i].name, &stu[i].m...
分类:编程语言   时间:2014-05-22 11:21:15    阅读次数:312
假定有20个 有序 数组,每个数组有500个数字,数字类型32位uint数值,现在需要取出这10000个数字中最大的500个,怎么做?
//3、假定有20个  有序   数组,每个数组有500个数字,数字类型32位uint数值,现在需要取出这10000个数字中最大的500个,怎么做? #include using namespace std; struct node { int data; int next; }; node obj[20]; void sift(int k,int m,int ...
分类:其他好文   时间:2014-05-22 10:54:48    阅读次数:292
POJ 3070 Fibonacci
Sol:就是求第N项的斐波那契数。矩阵乘法+快速幂 #include #include #include #include using namespace std; #define LL long long struct Mat{ LL f[2][2]; }; LL MOD = 10000; Mat mul(Mat a,Mat b) { LL i,j,k...
分类:其他好文   时间:2014-05-22 10:46:35    阅读次数:191
二进制查找树转换为双向链表
完全按照海涛哥剑指offer里边的递归思路来写的,基本一样,仅作学习验证,努力锻炼,努力学习!code如下: //Change a BSTree to a sorted double linklist struct BSTreeNode { int value; BSTreeNode *left; BSTreeNode *right; }head; //Create a node of...
分类:其他好文   时间:2014-05-22 10:23:27    阅读次数:237
链表的反转
题目:给出一个连续的链表,要求你将其结构改变反转。 例如:    输入:1 2 3 4 5    输出:5 4 3 2 1 #include #include #include typedef struct ListNode{ int m_pKey; ListNode * m_pNext; }; ListNode *ListReverse(ListNode *pHea...
分类:其他好文   时间:2014-05-22 08:16:58    阅读次数:210
Python3.2官方文档翻译--使用二进制数据记录布局和多线程
8.3 使用二进制数据记录布局 Struct模块提供了pack()和unpack()方法来处理可变长度的二进制格式。接下来的例子展示在一个没用zipfile模块的zipfile如何通过标题信息循环。压缩码“H”和“I”分别表示2和4字节无符号数字,“”表明都是标准大小并且按照little-endian字节排序。   8.4 多线程 线程是一种针对分离不连续和依赖的任务的技术。用线程可以提高...
分类:编程语言   时间:2014-05-22 07:26:58    阅读次数:311
System V信号量(1)
信号量和P、V原语由Dijkstra(迪杰斯特拉)提出 信号量 互斥:P、V在同一个进程中 同步:P、V在不同进程中 信号量值含义 S>0:S表示可用资源的个数 S=0:表示无可用资源,无等待进程 S 信号量 struct semaphore { int value; pointer_PCB queue; } P原语 P(s) ...
分类:其他好文   时间:2014-05-22 07:01:59    阅读次数:319
STM32学习之路-外部中断(2)
OK,继续上篇的内容. 配置好外部中断源以后, 就得使能外部中断线了. 为了方便看再借下这个图: 对外部中断的使能其实就是配置上面这些寄存器.即使能哪EXIT线,选择上面模式,是中断还是事件,选择下降沿还是上升沿. 具体怎么写寄存器这就不研究了, = = 太麻烦了.. 直接用STM32的库就行了,来看看它的代码吧 这是EXTI结构体的初始化函数, void EXTI_Struct...
分类:其他好文   时间:2014-05-22 06:43:16    阅读次数:395
LR杂记-用LoadRunner编写socket应用的测试脚本
DWORD WINAPI mythread( LPVOID lpParameter)    //客户线程{    struct My my;    memcpy(&my,lpParameter,sizeof(My));        printf("One client connect!\n");    char str1; ......
分类:其他好文   时间:2014-05-22 06:31:02    阅读次数:319
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!