易截截图软件、单文件、免安装、纯绿色、仅160KB

C程序:定义宏打印某位域共有多少位

#include <stdio.h>
#define bits(p, d) { \
int _tmp=p->d, _bits=0; \
for (p->d=1; p->d; p->d<<=1) \
_bits++; \
p->d=_tmp; \
printf("%s->%s has %d bits", #p, #d, _bits); \
}
typedef struct _s{
int a:4;
} S;
int main()
{
S tmp, *s = &tmp;
bits(s,a);
}
/* 输出: s->a has 4 bits */


相关文档:

通讯录C程序代码

#include <stdio.h>
#include <string.h> /* 程序多次调用biodkey(),应包含头文件bios.h */
#include <bios.h><br>/* 程序多次调用clrscr(),应包含头文件conio.h */
#include <conio.h>
#define MAX 100
#define PAGE 2
#define PRINT1 printf("------------------------------ ......

求方程ax^2+bx+c=0的根(函数)

#include<stdio.h>
#include<math.h>
float x1,x2,disc,p,q;
int main()
{
void greater_than_zero(float,float);
void equal_to_zero(float,float);
void smaller_than_zero(float,float);
float a,b,c;
printf("\ninput a,b,c:");
scanf("%f,%f,%f",&a,&b,&c) ......

C3P0数据源 连接Access数据库


<?xml version="1.0" encoding="UTF-8"?>  
<beans xmlns="http://www.springframework.org/schema/beans"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    xsi:schemaLocation="http://www.spri ......

C程序:判断链表是否有环

/*
这是个常见的面试题哦,总之我面试的时候遇到过, 当时没有答上来
回去后想出来下面的方法一,该法还有个附加优点,可以判断出链表在哪个地方形成环的(即如果想拆开这个环,从哪个地方断开)。
后来知道还有个经典算法,即使用两个指针,一快一慢向前试探,如果最终重合则链表有环,果然优美的算法。
*/
#inc ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号