´Óprintf()̸c/c++Öпɱä²ÎÊýº¯ÊýµÄʵÏÖ
´Óprintf̸¿É±ä²ÎÊýº¯ÊýµÄʵÏÖ ×ªÌù
ÔÎÄ×÷ÕߣºÈÖÑÇÐÂ
ÕªÒª£ºÒ»Ö±ÒÔÀ´¶¼¾õµÃprintfËÆºõÊÇcÓïÑÔ¿âÖй¦ÄÜ×îÇ¿´óµÄº¯ÊýÖ®Ò»£¬²»½öÒòΪËüÄܸñʽ»¯Êä³ö£¬¸üÔÚÓÚËüµÄ²ÎÊý¸öÊýûÓÐÏÞÖÆ£¬Òª¼¸¸ö¾Í¸ø¼¸¸ö£¬À´Õß²»¾Ü¡£printfÕâÖÖ¶Ô²ÎÊý¸öÊýºÍ²ÎÊýÀàÐ͵ÄÇ¿´óÊÊÓ¦ÐÔ£¬ÈÃÈ˲úÉúÁ˶ÔËü½øÐÐ̽Ë÷µÄŨºñÐËȤ¡£
¹Ø¼ü×Ö£ºprintf, ¿É±ä²ÎÊý
1. ʹÓÃÇéÐÎ
int a =10;
double b = 20.0;
char *str = "Hello world";
printf("begin print\n");
printf("a=%d, b=%.3f, str=%s\n", a, b, str);
...
¡¡¡¡´ÓprintfµÄʹÓÃÇé¿öÀ´¿´£¬ÎÒÃDz»ÄÑ·¢ÏÖÒ»¸ö¹æÂÉ£¬¾ÍÊÇÎÞÂÛÆä¿É±äµÄ²ÎÊýÓжàÉÙ¸ö£¬printfµÄµÚÒ»¸ö²ÎÊý×ÜÊÇÒ»¸ö×Ö·û´®¡£¶øÕýÊÇÕâµÚÒ»¸ö²ÎÊý£¬Ê¹µÃËü¿ÉÒÔÈ·ÈϺóÃæ»¹ÓÐÓжàÉÙ¸ö²ÎÊýÎ²Ëæ¡£¶øÎ²ËæµÄÿ¸ö²ÎÊýÕ¼ÓõÄÕ»¿Õ¼ä´óСÓÖÊÇͨ¹ýµÚÒ»¸ö¸ñʽ×Ö·û´®È·¶¨µÄ¡£È»¶øprintfµ½µ×ÊÇÔõÑùÈ¡µÚÒ»¸ö²ÎÊýºóÃæµÄ²ÎÊýÖµµÄÄØ£¬Çë¿´ÈçÏ´úÂë
2. printf º¯ÊýµÄʵÏÖ
//acenv.h
typedef char *va_list;
#define _AUPBND (sizeof (acpi_native_int) - 1)
#define _ADNBND (sizeof (acpi_native_int) - 1)
#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
#define va_end(ap) (void) 0
#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
//start.c
static char sprint_buf[1024];
int printf(char *fmt, ...)
{
va_list args;
int n;
va_start(args, fmt);
n = vsprintf(sprint_buf, fmt, args);
va_end(args);
write(stdout, sprint_buf, n);
return n;
}
//unistd.h
stati
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸е쬻î»î»î£¡
&n ......
http://social.msdn.microsoft.com/Forums/en/sqltools/thread/07db294a-79e5-4a5a-916c-6a51e44a5aa4
http://www.pcreview.co.uk/forums/thread-211705.php
Download "MsiZap.exe" from http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 ......
NetBeansÌṩÁËÒ»¸öºÜºÃµÄC/C++¿ª·¢»·¾³£¬Õâ¸ö¿ª·¢»·¾³ÊÇ»ùÓÚGCC±àÒëÆ÷£¬ËùÒÔÔÚWindowsÉÏÊÇÐèҪͨ¹ýÅäÖòÅÄÜʹÓÃNetBeansµÄC/C++ƽ̨¡£
ÅäÖÃÖ»ÓÐÈý²½£º
1¡¢ÏÂÔØMinGWºÍMSYS
2¡¢ÅäÖÃMSYSµÄ»·¾³±äÁ¿
3¡¢ÔÚNetBeansÖÐÅäÖÃC/C++ƽ̨
-------------------------
µÚÒ»²½£ºÏÂÔØMinGWºÍMSYS
Ê×ÏÈÐèÒªÏÂÔØMinGWºÍMSYS£¬MinGWÊ ......
[ZT]×Ô¼º¶¯ÊÖÓà C À©Õ¹ PHP
ÒýÑÔ:
ÓиÐÓÚ´ó¶àÊýÈËÈÏΪ PHP Ö»ÊÇÒ»ÖÖÈõÀàÐÍ£¬Ö»ÄÜ×öСÐÍwebÓ¦ÓõĽű¾ÓïÑÔ¡£ ÓëĿǰµÄJava, .Netƽ̨ÓÐÒ»¶¨µÄ²î¾à£¬ËùÒÔ¾ö¶¨Ð´Ò»Ð© PHP µÄÀ©Õ¹·½·¨ÎÄÕ£¬ÎÒÏàÐÅ
ÎÒÃÇPHPERÃÇͨ¹ý×Ô¼º¶¯ÊÖдÉÌÒµÀ©Õ¹£¬Ò»¶¨Äܹ¹½¨³öÇ¿´óµÄ£¬¼«ËÙµÄWebÓ¦Óã¬ÒòΪÀ©Õ¹±¾Éí¾ÍÊDZàÒëÐÍÓïÑÔ±àдµÄ(c ......
(À´Ô´£ºjava±à³Ì˼Ïë)
“×÷ΪһÃûC++³ÌÐòÔ±£¬ÎÒÃÇÔçÒÑÕÆÎÕÁËÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄ»ù±¾¸ÅÄ¶øÇÒJavaµÄÓï·¨ÎÞÒÉÊǷdz£ÊìϤµÄ¡£ÊÂʵÉÏ£¬Java±¾À´¾ÍÊÇ´ÓC++ÑÜÉú³öÀ´µÄ¡£”
È»¶ø£¬C++ºÍJavaÖ®¼äÈÔ´æÔÚһЩÏÔÖøµÄ²îÒì¡£¿ÉÒÔÕâÑù˵£¬ÕâЩ²îÒì´ú±í׿¼ÊõµÄ¼«´ó½ø²½¡£Ò»µ©ÎÒÃÇŪÇå³þÁËÕâЩ²îÒ죬¾Í»áÀí½âΪʲô˵Ja ......