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

תC/C++ºÍ»ã±à»ìºÏ±à³Ì

תCºÍ»ã±à»ìºÏ±à³Ì
.dataÊdzõʼ»¯µÄÊý¾Ý¿é¡£ÕâЩÊý¾Ý°üÀ¨±àÒëʱ±»³õʼ»¯µÄglobleºÍstatic±äÁ¿£¬Ò²°üÀ¨×Ö·û´®¡£
Á¬½ÓÆ÷½«OBJs¼°LIBsÎļþµÄ.data½áºÏ³ÉÒ»¸ö´óµÄ.data¡£local±äÁ¿ÒÔ·ÅÔÚÒ»¸öÏßÐԵĶÑÕ»ÖУ¬
²»Õ¼.dataºÍ.bssµÄ¿Õ¼ä¡£ºÍ.textÒ»Ñù£¬Êý¾Ý¿éÊÇÒÔÃ÷ÎĵÄÐÎʽ´æ·ÅÔÚÎļþÖеġ£ÎÞ·¨·ÀÖ¹¶ÔÆäÎïÀíµÄÐ޸ġ£
.bssÇøÊÇ´æ·Åδ³õʼ»¯È«¾ÖºÍ¾²Ì¬±äÁ¿µÄ¡£
ÔÚCºÍ»ã±à»ìºÏ±à³ÌµÄʱºò£¬´æÔÚCÓïÑԺͻã±àÓïÑԵıäÁ¿ÒÔ¼°º¯ÊýµÄ½Ó¿ÚÎÊÌâ¡£
ÔÚC³ÌÐòÖж¨ÒåµÄ±äÁ¿£¬±àÒëΪ.asmÎļþºó£¬¶¼±»·Å½øÁË.bssÇø£¬¶øÇÒ±äÁ¿ÃûµÄÇ°Ã涼´øÁËÒ»¸öÏ»®Ïß¡£ÔÚC³ÌÐòÖж¨ÒåµÄº¯Êý£¬±àÒëºóÔÚº¯ÊýÃûÇ°Ò²´øÁËÒ»¸öÏ»®Ïß¡£ÀýÈ磺
extern int num¾Í»á±ä³É .bss _num, 1
extern float nums[5]¾Í»á±ä³É.bss _nums, 5
extern void func ( )¾Í»á±ä³É _func,
 º¯ÊýÉùÃ÷: CÖÐÔÚº¯ÊýÇ°¼ÓexternÉùÃ÷´Ëº¯ÊýΪÍⲿº¯Êý£¬ÔÚ»ã±àÖÐÒªÉùÃ÷º¯ÊýÃûΪȫ¾Ö±äÁ¿£¬È磺
   extern void delay(void) ;  /*in C*/
   globl delay   ; in asm
 _delay:   ; delay function begins
£¨1£© »ã±à³ÌÐòÖзÃÎÊc³ÌÐòÖеıäÁ¿ºÍº¯Êý¡£
ÔÚ»ã±à³ÌÐòÖУ¬ÓÃ_XX¾Í¿ÉÒÔ·ÃÎÊCÖеıäÁ¿XXÁË¡£·ÃÎÊÊý×éʱ£¬¿ÉÒÔÓÃ_XX+Æ«ÒÆÁ¿À´·ÃÎÊ£¬Èç_XX+3·ÃÎÊÁËÊý×éÖеÄXX[3]¡£
    ÔÚ»ã±à³ÌÐòµ÷ÓÃCº¯Êýʱ£¬Èç¹ûûÓвÎÊý´«µÝ£¬Ö±½ÓÓÃ_funcname ¾Í¿ÉÒÔÁË¡£Èç¹ûÓвÎÊý´«µÝ£¬ Ôòº¯ÊýÖÐ×î×ó±ßµÄÒ»¸ö²ÎÊýÓɼĴæÆ÷A¸ø³ö£¬ÆäËûµÄ²ÎÊý°´Ë³ÐòÓɶÑÕ»¸ø³ö¡£·µ»ØÖµÊÇ·µ»Øµ½A¼Ä´æÆ÷»òÕßÓÉA¼Ä´æÆ÷¸ø³öµÄµØÖ·¡£Í¬Ê±×¢Ò⣬ΪÁËÄܹ»Èûã±àÓïÑÔÄÜ·ÃÎʵ½CÓïÑÔÖж¨ÒåµÄ±äÁ¿ºÍº¯Êý£¬ËûÃDZØÐëÉùÃ÷ΪÍⲿ±äÁ¿£¬¼´¼Óextern ǰ׺¡£
£¨2£© c³ÌÐòÖзÃÎÊ»ã±à³ÌÐòÖеıäÁ¿
    Èç¹ûÐèÒªÔÚc³ÌÐòÖзÃÎÊ»ã±à³ÌÐòÖеıäÁ¿£¬Ôò»ã±à³ÌÐòÖеıäÁ¿Ãû±ØÐëÒÔÏ»®ÏßΪÊ××Ö·û£¬²¢ÓÃglobalʹ֮³ÉΪȫ¾Ö±äÁ¿¡£
    Èç¹ûÐèÒªÔÚc³ÌÐòÖе÷Óûã±à³ÌÐòÖеĹý³Ì£¬Ôò¹ý³ÌÃû±ØÐëÒÔÏ»®ÏßΪÊ××Ö·û£¬²¢ÇÒ£¬Òª¸ù¾Ýc³ÌÐò±àÒëʱʹÓõÄģʽÊÇstack-based model»¹ÊÇregister argument modelÀ´ÕýÈ·µØ±àд¸Ã¹ý³Ì£¬Ê¹Ö®ÄÜÕýÈ·µØÈ¡µÃµ÷ÓòÎÊý¡£
£¨3£© ÔÚÏß»ã±à
    ÔÚC³ÌÐòÖÐÖ±½Ó²åÈë asm(“ *** ”)£¬ÄÚǶ»ã±àÓï¾ä£¬ÐèҪעÒâµÄÊÇÕâÖÖÓ÷¨ÒªÉ÷Óã¬ÔÚÏß»ã±àÌṩÁËÄÜÖ±½Ó¶ÁдӲ¼þµÄÄÜÁ¦£¬Èç¶ÁдÖжϿØÖÆÔÊÐí¼Ä´æÆ÷µÈ£¬µ«±àÒëÆ÷²¢²»¼ì²éºÍ·ÖÎöÔÚÏß»ã±àÓïÑÔ£¬²åÈëÔ


Ïà¹ØÎĵµ£º

JavaScript Calls from C++

×î½üÒªÓõ½Ïà¹Ø¼¼Êõ£¬ÏÈÌùÔÚÕ⣬ÓпÕÔÙ·­Ò³¡£
±¾ÎÄת×Ô£º
http://www.codeguru.com/Cpp/I-N/ieprogram/article.php/c4399
http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c4399/JavaScript-Calls-from-C.htm
http://www.codeproject.com/KB/COM/jscalls.aspx

Introduction
Sometimes, when we are usi ......

cÁ¬½Ó·û

cÓïÑԺ궨ÒåµÄÁ¬½Ó·ûÓÐÄÄЩ
[´ËÎÊÌâµÄÍƼö´ð°¸]
(Ò»)ºê¶¨ÒåÖеÄ## Á¬½Ó·ûÓë# ·û
## Á¬½Ó·ûºÅÓÉÁ½¸ö¾®ºÅ×é³É£¬Æ书ÄÜÊÇÔÚ´ø²ÎÊýµÄºê¶¨ÒåÖн«Á½¸ö×Ó´®(token)Áª½ÓÆðÀ´£¬´Ó¶øÐγÉÒ»¸öеÄ×Ó´®¡£µ«Ëü²»¿ÉÒÔÊǵÚÒ»¸ö»òÕß×îºóÒ»¸ö×Ó´®¡£ËùνµÄ×Ó´®(token)¾ÍÊÇÖ¸±àÒëÆ÷Äܹ»Ê¶±ðµÄ×îСÓï·¨µ¥Ôª¡£¾ßÌåµÄ¶¨ÒåÔÚ±àÒëÔ­ÀíÀïÓÐÏ꾡µÄ ......

[C/C++] °ÑÒ»¸öÕûÐÍÕûÊýת³É×Ö·û´®

ÎÊÌâÃèÊö£ºÐ´Ò»¸öº¯Êý£¬½ÓÊÜÒ»¸öÕûÊý£¨¼Ù¶¨ÓÃint±íʾ£©£¬Êä³ö¸ÃÕûÊýµÄ×Ö·û´®ÐÎʽ¡£²ÉÓÃÈçϺ¯ÊýÔ­ÐÍ£º
void itoa ( int val, char* buf );

ÕâÀï¼Ù¶¨buf×ã¹»´óÒÔÈÝÄÉÈκÎintÀàÐÍÊýÖµµÄ×Ö·û´®¡£
Õâ¸öÎÊÌ⣬³õ¿´ºÃÏñûÓÐʲôÄѶȡ£Èç¹ûÊÇ0£¬¾ÍÖ±½ÓÊä³ö'0'£»Èç¹ûÊÇÕýÊý£¬¾Íͨ¹ýÈ¡Ä£(%)ºÍÇóÉÌ(/)ÔËËã¿ÉÒÔÖðλȡµÃ¸ÃÕûÊýµÄÊ ......

mysql C±à³Ì£¨Ò»£©mysql´íÎóÂ룬¹ØÓÚmysql_errno

¼ÙÉèÎÒÃÇʹÓÃmysql_real_queryÖ´ÐÐÁËÒ»ÌõsqlÓï¾äÖ®ºó£¬·µ»ØֵΪ·Ç0Öµ£¬´ó¼Ò¶¼ÖªµÀÕâÊÇÕâÌõÓï¾äÖ´Ðгö´í£¬µ«ÊÇÎÒÃÇÏë
Á˽âµØ¸üÏêϸµãµÄ»°£¬¾¿¾¹ÊÇʲôԭÒòµ¼ÖÂÁËÕâ¸ö´íÎóÄØ£¿Õâʱºò¾ÍµÃÓÃÉÏmysqlÌṩµÄÁíÍâÒ»¸öAPI£ºmysql_errno¡£
mysql_errno»áÌṩ×î½üÒ»´Îµ÷ÓõÄC API³ö´íµÄÐÅÏ¢£¨²»¼ûµÃÿ¸öAPI¶¼»á¶ÔÕâ¸öerrno½øÐÐÉèÖ ......

ÔÚJavaScript µ÷ÓÃC++

·½°¸Ò»£º
// html & JavaScript
...
<button value="Click me"
onclick="window.navigate('app:command&arg1=1&arg2=2')" />
...
 // C++: ÏìÓ¦ µÄÏûÏ¢º¯ÊýOnBeforeNavigat2 
virtual void OnBeforeNavigate2( LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTar ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ