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 */
Ïà¹ØÎĵµ£º
ÔÚC++ÖУ¬¹ØÓÚCPPµÄÍ·Îļþ»¥Ïà°üº¬µÄÎÊÌâºÜÈÃÈËÍ·ÌÛ£¬ÆäʵÎÒÃÇËÒ²²»Ô¸ÒâŪµÄ½á¹¹»ìÂÒ£¬ÄÑÒÔÀí½â£¬µ«ÓÐʱÓÖÊÇÓбØÐëµÄ¡£
¼Ù¶¨µ±Ç°ÓÐÁ½¸öÍ·Îļþ·Ö±ðΪ A.h ºÍ B.h£¬ÄÚÈÝ·Ö±ðÈçÏ£º
A.hÄÚÈÝΪ£º
#ifndef  ......
ÊÔÌâ5£º±àдһ¸öº¯Êý£¬×÷ÓÃÊǰÑÒ»¸öchar×é³ÉµÄ×Ö·û´®Ñ»·ÓÒÒÆn¸ö¡£±ÈÈçÔÀ´ÊÇ“abcdefghi”Èç¹ûn=2£¬ÒÆÎ»ºóÓ¦¸ÃÊÇ“hiabcdefgh”
¡¡¡¡º¯ÊýÍ·ÊÇÕâÑùµÄ£º
//pStrÊÇÖ¸ÏòÒÔ'\0'½áβµÄ×Ö·û´®µÄÖ¸Õë
//stepsÊÇÒªÇóÒÆ¶¯µÄn
void LoopMove ( char * pStr, int steps )
{
¡¡//ÇëÌî³ä...
}
¡¡¡¡½ ......
#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("------------------------------ ......
<?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 ......
/*
˼·£ºµÝ¹éËã·¨
ǰ0..cur-1λÖÃÉÏÒѾÅźã¬µ±Ç°curλÖÃȡһ¸öºÍÇ°Ãæ¶¼²»Ò»ÑùµÄ£¬È»ºóµÝ¹é´¦ÀíºóÃæµÄ¡£
*/
/* Êä³ö1,2,3,..,nµÄÅÅÁÐÊý */
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
void p(int n)
{
extern void _p(int n, int cur, int *a);
int *a;
a = ......