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

c/c++Ö§³Ö¿É±ä²ÎÊýµÄº¯Êý

c/c++Ö§³Ö¿É±ä²ÎÊýµÄº¯Êý£¬¼´º¯ÊýµÄ²ÎÊýÊDz»È·¶¨µÄ¡£
Ò»¡¢ÎªÊ²Ã´ÒªÊ¹Óÿɱä²ÎÊýµÄº¯Êý£¿
Ò»°ãÎÒÃDZà³ÌµÄʱºò£¬º¯ÊýÖÐÐÎʽ²ÎÊýµÄÊýĿͨ³£ÊÇÈ·¶¨µÄ£¬ÔÚµ÷ÓÃʱҪÒÀ´Î¸ø³öÓëÐÎʽ²ÎÊý¶ÔÓ¦µÄËùÓÐʵ¼Ê²ÎÊý¡£µ«ÔÚijЩÇé¿öÏÂÏ£Íûº¯ÊýµÄ²ÎÊý¸öÊý¿ÉÒÔ¸ù¾ÝÐèҪȷ¶¨£¬Òò´ËcÓïÑÔÒýÈë¿É±ä²ÎÊýº¯Êý¡£ÕâÒ²ÊÇc¹¦ÄÜÇ¿´óµÄÒ»¸ö·½Ã棬ÆäËüijЩÓïÑÔ£¬±ÈÈçfortran¾ÍûÓÐÕâ¸ö¹¦ÄÜ¡£
µäÐ͵Ŀɱä²ÎÊýº¯ÊýµÄÀý×ÓÓдó¼ÒÊìϤµÄprintf()¡¢scanf()µÈ¡£
¶þ¡¢c/c++ÈçºÎʵÏֿɱä²ÎÊýµÄº¯Êý£¿
ΪÁËÖ§³Ö¿É±ä²ÎÊýº¯Êý£¬CÓïÑÔÒýÈëеĵ÷ÓÃЭÒ飬 ¼´CÓïÑÔµ÷ÓÃÔ¼¶¨ __cdecl ¡£ ²ÉÓÃC/C++ÓïÑÔ±à³ÌµÄʱºò£¬Ä¬ÈÏʹÓÃÕâ¸öµ÷ÓÃÔ¼¶¨¡£Èç¹ûÒª²ÉÓÃÆäËüµ÷ÓÃÔ¼¶¨£¬±ØÐëÌí¼ÓÆäËü¹Ø¼ü×ÖÉùÃ÷£¬ÀýÈçWIN32 APIʹÓÃPASCALµ÷ÓÃÔ¼¶¨£¬º¯ÊýÃû×Ö֮ǰ±ØÐë¼Ó__stdcall¹Ø¼ü×Ö¡£
²ÉÓÃCµ÷ÓÃÔ¼¶¨Ê±£¬º¯ÊýµÄ²ÎÊýÊÇ´ÓÓÒµ½×óÈëÕ»£¬¸öÊý¿É±ä¡£ÓÉÓÚº¯ÊýÌå²»ÄÜÔ¤ÏÈÖªµÀ´«½øÀ´µÄ²ÎÊý¸öÊý£¬Òò´Ë²ÉÓñ¾Ô¼¶¨Ê±±ØÐëÓɺ¯Êýµ÷ÓÃÕ߸ºÔð¶ÑÕ»ÇåÀí¡£¾Ù¸öÀý×Ó£º
//Cµ÷ÓÃÔ¼¶¨º¯Êý
int __cdecl Add(int a, int b)
{
return (a + b);
}
º¯Êýµ÷Óãº
Add(1, 2);
//»ã±à´úÂëÊÇ£º
push 2 ;²ÎÊýbÈëÕ»
push 1 ;²ÎÊýaÈëÕ»
call @Add ;µ÷Óú¯Êý¡£Æäʵ»¹ÓбàÒëÆ÷ÓÃÓÚ¶¨Î»º¯ÊýµÄ±í´ïʽÕâÀï°ÑËüÊ¡ÂÔÁË
add esp,8 ;µ÷ÓÃÕ߸ºÔðÇåÕ»
Èç¹ûµ÷Óú¯ÊýµÄʱºòʹÓõĵ÷ÓÃЭÒéºÍº¯ÊýÔ­ÐÍÖÐÉùÃ÷µÄ²»Ò»Ö£¬¾Í»áµ¼ÖÂÕ»´íÎó£¬ÕâÊÇÁíÍâÒ»¸ö»°Ì⣬ÕâÀï²»ÔÙϸ˵¡£
ÁíÍâc/c++±àÒëÆ÷²ÉÓúêµÄÐÎʽ֧³Ö¿É±ä²ÎÊýº¯Êý¡£ÕâЩºê°üÀ¨va_start¡¢va_argºÍva_endµÈ¡£Ö®ËùÒÔÕâô×ö£¬ÊÇΪÁËÔö¼Ó³ÌÐòµÄ¿ÉÒÆÖ²ÐÔ¡£ÆÁ±Î²»Í¬µÄÓ²¼þƽ̨Ôì³ÉµÄ²îÒì¡£
Ö§³Ö¿É±ä²ÎÊýº¯ÊýµÄËùÓк궼¶¨ÒåÔÚstdarg.h ºÍ varargs.hÖС£ÀýÈç±ê×¼ANSIÐÎʽÏ£¬ÕâЩºêµÄ¶¨ÒåÊÇ£º
typedef char * va_list; //×Ö·û´®Ö¸Õë
#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
#define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) )
#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
#define va_end(ap) ( ap = (va_list)0 )
ʹÓúê_INTSIZEOFÊÇΪÁË°´ÕÕÕûÊý×Ö½Ú¶ÔÆëÖ¸Õ룬ÒòΪcµ÷ÓÃЭÒéÏÂÃ棬²ÎÊýÈëÕ»¶¼ÊÇÕûÊý×Ö½Ú£¨Ö¸Õë»òÕßÖµ£©¡£
Èý¡¢ÈçºÎ¶¨ÒåÕâÀàµÄº¯Êý¡£
¿É±ä²ÎÊýº¯ÊýÔÚ²»Í¬µÄϵͳÏ£¬²ÉÓò»Í¬µÄÐÎʽ¶¨Òå¡£
1¡¢ÓÃANSI±ê×¼ÐÎʽʱ£¬²ÎÊý¸öÊý¿É±äµÄº¯ÊýµÄÔ­ÐÍÉùÃ÷ÊÇ£º
type funcname(type para1, type para2, …);


Ïà¹ØÎĵµ£º

³£ÓÃC¿âº¯ÊýÓëWIN32º¯Êý±È½ÏÒ»ÀÀ±í


Win32 Equivalents for C Run-Time Functions
ID: Q99456
The information in this article applies to:
Microsoft Win32 Application Programming Interface (API), included with:
Microsoft Windows NT, versions 3.1, 3.5, 3.51
Microsoft Windows 95
 
SUMMARY
Many of the C Run-time functions have ......

S3C24XXÌåϵµÄLinux GPIO¿ØÖÆÏà¹ØAPIʵÏÖ

GPIO£¨General Purpose Input/OutputµÄËõд£©¾ÍÊÇоƬµÄÒý½Å£¬Òý½ÅÊǿɱà³ÌµÄ¿É¶ÔÒý½ÅµÄ¹¤×÷ģʽ½øÐÐÉèÖãºÊäÈëģʽ(¼ì²âÊäÈëÐźÅ)£¬Êä³öģʽ(Êä³ö0»ò1)£¬¸ß×è״̬(³£ÓÃÓÚADת»»)£¬»¹ÓнûÖ¹»òÔÊÐíÉÏÄÚ²¿ÏÂÀ­µç×è(ÉÏÀ­£º¹Ü½Åͨ¹ýµç×è½Ó¸ßµçƽ£¬ÏÂÀ­£º¹Ü½Åͨ¹ýµç×è½ÓµØ£¬Ò²¿ÉÒÔÍⲿ½ÓÉÏÀ­»òÏÂÀ­µç×è)£¬»¹ÓйܽŸ´Óõȹ¦ÄÜ£¬¼´ ......

[C/C++ Digestion] – ×Ôµ×ÏòÉϵØ̽¾¿Ð麯Êý


[C/C++ Digestion] –
×Ôµ×ÏòÉϵØ̽¾¿Ð麯Êý
×÷Õߣº
Jason Lee @
http://blog.csdn.net/jasonblog
ÈÕÆÚ£º
2010-05-19
»·¾³£º
Visual C++ Express
2008
ÉùÃ÷£º±¾ÎÄ·¢±íÔÚ
csdn
²©¿Í£¬ÈçÓÐתÔØ£¬Çë×¢Ã÷³ö´¦
 
[1]C++
¶ÔÏóÄ£ÐÍ»ù´¡
Ò»¸öÀàÖпÉÒÔ°üº¬¾²Ì¬Êý¾Ý³ÉÔ±¡¢¾²Ì¬³ÉÔ±º¯Êý¡¢·Ç¾²Ì¬³ÉÔ±º¯Êýº ......

±à³ÌÒÕÊõ(C/C++)


1¡¢¿ìËÙ³õʼ»¯
char  *str = new [size];
str[0]='\0';
 
 
2¡¢memcpyµÄÃîÓÃ
 
ÊÔÌâ6£ºÒÑÖªWAVÎļþ¸ñʽÈçÏÂ±í£¬´ò¿ªÒ»¸öWAVÎļþ£¬ÒÔÊʵ±µÄÊý¾Ý½á¹¹×éÖ¯WAVÎļþÍ·²¢½âÎöWAV¸ñʽµÄ¸÷ÏîÐÅÏ¢¡£
  WAVEÎļþ¸ñʽ˵Ã÷±í
Æ«ÒƵØÖ· ×Ö½ÚÊý Êý¾ÝÀàÐÍ ÄÚ ÈÝ
ÎļþÍ·
00H 4 Char "RIFF"±êÖ¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ