Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c programs

void myprintf(const char *format, ...)
{
va_list arglist;
va_start(arglist, format);
vprintf(format, arglist); // or some other operation
va_end(arglist);
}
NAME
       printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - formatted output conversion
SYNOPSIS
       #include <stdio.h>
       int printf(const char *format, ...);
       int fprintf(FILE *stream, const char *format, ...);
       int sprintf(char *str, const char *format, ...);
       int snprintf(char *str, size_t size, const char *format, ...);
       #include <stdarg.h>
       int vprintf(const char *format, va_list ap);
       int vfprintf(FILE *stream, const char *format, va_list ap);
       int vsprintf(char *str, const char *format, va_list ap);
       int vsnprintf(char *str, size_t size, const char *format, va_list ap);
#include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#define DBG1(format, ...) do { \
fprintf(stderr, "DBG(%s@%d): "format, basename(__FILE__), __LINE__, ##__VA_ARGS__); \
} while (0)
#define DBG2(format, arg...) do { \
fprintf(stderr, "DBG(%s@%d): "format, __FILE__, __LINE__, ##arg); \
} while (0)
int main(void)
{
DBG1("this is debug info\n");
DBG2("this is debug info\n");
return 0;


Ïà¹ØÎĵµ£º

cÖÐÄÚ´æ·ÖÅä&±äÁ¿µÄ´æ´¢Àà±ð

Ò»ÔÚcÖзÖΪÕ⼸¸ö´æ´¢Çø
1.Õ» - ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å
2.¶Ñ - Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøÊ±¿ÉÄÜÓÉOS»ØÊÕ
3.È«¾ÖÇø£¨¾²Ì¬Çø£©£¬È«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿µÄ´æ´¢ÊÇ·ÅÔÚÒ»¿éµÄ£¬³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿ÔÚÒ»¿éÇøÓò£¬Î´³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍδ³õʼ»¯µÄ¾²Ì¬±äÁ¿ÔÚÏàÁÚµÄÁíÒ»¿éÇøÓò¡£- ³ÌÐò½áÊøÊÍ·Å
4.´æ´¢³ ......

˳ʱÕë·½·¨ ½â¶Á C ¸´ÔӺ궨Òå

[This was posted to comp.lang.c by its author, David Anderson, on 1994-05-06.]
The ``Clockwise/Spiral Rule''
By David Anderson
There is a technique known as the ``Clockwise/Spiral Rule'' which enables any C programmer to parse in their head any C declaration!
There are three simple steps to fo ......

CµÄ¶¯Ì¬ÄÚ´æ¹ÜÀí mallac()ºÍfree()

      ¹ØÓÚcµÄ¶¯Ì¬ÄÚ´æ¹ÜÀíÒ»Ö±ÊǸö¾­¾Ã²»Ë¥µÄ»°Ìâ,ÃæÊÔÒ²ÊÇ»ù±¾É϶¼»á¿¼µÄ,±¾À´¸Ð¾õÒѾ­Ã÷°×ÁË,µ«ÊǽñÌìʹÓõÄʱºòÒ»²»Ð¡Ðĵ¼Ö³ÌÐò±ÀÀ£ÁË,Òò´ËÉîÈëµÄÈ¥²éÁËÏÂ×ÊÁÏ,ÊÕ»ñ²»ÉÙ...Ìù³öÀ´Óë´ó¼Ò·ÖÏí...
     ÏÈÌù¸ö´íÎó´úÂë:
     int * ptr = (int *)mal ......

ʵÀý½âÎölinuxÄÚºËI2CÌåϵ½á¹¹

Ò»¡¢¸ÅÊö
̸µ½ÔÚlinuxϵͳϱàдI2CÇý¶¯£¬Ä¿Ç°Ö÷ÒªÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊǰÑI2CÉ豸µ±×÷Ò»¸öÆÕͨµÄ×Ö·ûÉ豸À´´¦Àí£¬ÁíÒ»ÖÖÊÇÀûÓÃlinux I2CÇý¶¯Ìåϵ½á¹¹À´Íê³É¡£ÏÂÃæ±È½ÏÏÂÕâÁ½ÖÖÇý¶¯¡£
µÚÒ»ÖÖ·½·¨µÄºÃ´¦£¨¶ÔÓ¦µÚ¶þÖÖ·½·¨µÄÁÓÊÆ£©ÓУº
        ¡ñ    ˼·±È½ÏÖ±½Ó£¬²»ÐèÒª ......

CС³ÌÐò£¨Ôöɾ¸Ä²éÈ«ÃæÁ·Ï°£©

1.ÅÅÐòС³ÌÐò£ºÁ·Ï°ÅÅÐò»ù±¾Ëã·¨ºÍº¯ÊýµÄÓ¦Ó㬲¢Ìåζº¯ÊýÓ÷¨µÄºÃ´¦¡£
 #include "stdio.h"
#include "stdlib.h"
#include "string.h"
#define DATA 10
int ArrGrounp[ DATA ];
int ArrGrounp1[DATA];
#define DEFINE1 "ÇëÊäÈë10¸öÊý£º\n"
#define DEFINE2 "Âú×ãÌõ¼þµÄÊýÓУº"
#define DEFINE3 "\nÂú×ãÌõ¼þ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ