C³ÌÐò£º¶¨Òåºê´òӡijλÓò¹²ÓжàÉÙλ
#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 */
Ïà¹ØÎĵµ£º
ͻ񻣼
ÔÚѧϰlinuxÄں˴úÂ뼰һЩ¿ªÔ´Èí¼þµÄÔ´Â루È磺DirectFB£©£¬¾³£¿ÉÒÔ¿´µ½ÓйØ
__attribute__µÄÏà¹ØʹÓᣱ¾ÎĽáºÏ×Ô¼ºµÄѧϰ¾Àú£¬½ÏΪÏêϸµÄ½éÉÜÁË__attribute__
Ïà¹ØÓï·¨¼°ÆäʹÓá£
---------------------------------------------------------
ÉùÃ÷£º
´ËÎÄΪԴ´£¬»¶ÓתÔØ£¬×ªÔØÇë±£ÁôÈçÏÂÐÅÏ¢
& ......
#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("------------------------------ ......
µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
µ¥Ôª²âÊÔЧÒæÌرð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔÒò¾ÍÊÇÄÑÓÚÍ»ÆƿɲâÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......
ººÅµËþËã·¨µÄµÝ¹éÓë·ÇµÝ¹éµÄCÒÔ¼°C++Ô´´úÂë
By Minidxer | January 30, 2008
ººÅµËþ£¨ÓֳƺÓÄÚËþ£©ÎÊÌâÆäʵÊÇÓ¡¶ÈµÄÒ»¸ö¹ÅÀϵĴ«Ëµ¡£
¿ªÌì±ÙµØµÄÉñ²ªÀÂ꣨ºÍÖйúµÄÅ̹Ų¶àµÄÉñ°É£©ÔÚÒ»¸öÃíÀïÁôÏÂÁËÈý¸ù½ð¸ÕʯµÄ°ô£¬µÚÒ»¸ùÉÏÃæÌ××Å64¸öÔ²µÄ½ðƬ£¬×î´óµÄÒ»¸öÔÚµ×Ï£¬ÆäÓàÒ»¸ö±ÈÒ»¸öС£¬ÒÀ´ÎµþÉÏ ......
/*
˼·£ºµÝ¹éËã·¨
´Ó¿ªÊ¼ÍùºóµÝÔöµØдÊý×Ö£¬µ±Ç°´ÓnowÖµ¿ªÊ¼£¬´æ´¢µÄλÖôÓcur¿ªÊ¼£¬
ÔòÏÔÈ»¼ÓÉÏ£¬now..n£¬¶¼ÊÇеÄ×éºÏÊý£¬¶ÔÓÚÿһ¸ö£¬{ Êä³öÖ®£¬È»ºóµÝ¹é£¬´¦Àí _c(n, cur+1, a, i+1) }
*/
/* Êä³ö1,2,3,..,nµÄ×éºÏÊý */
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
void ......