extern "C"µÄ×÷ÓÃ
Ò»¡¢ÐÞÊÎÃû£¨Decorated Name£©
C/C++³ÌÐòÖеĺ¯ÊýÔÚÄÚ²¿ÊÇͨ¹ýÐÞÊÎÃûÀ´±êʶµÄ¡£ÐÞÊÎÃûÊÇÔÚº¯Êý¶¨Òå»òÔÐͱàÒë½×¶ÎÓɱàÒëÆ÷´´½¨×Ö·û´®¡£µ±ÄãÔÚLINKµÈ¹¤¾ßÖÐÒªÖ¸¶¨Ò»¸öº¯ÊýÃûʱ£¬»áÓõ½ÐÞÊÎÃû¡£
1¡¢Ê¹ÓÃÐÞÊÎÃû£º
´ó¶àÊýÇé¿öÏ£¬Äã²»±ØÖªµÀº¯ÊýµÄÐÞÊÎÃûÊÇʲô¡£Á¬½ÓÆ÷µÈ¹¤¾ßͨ³£¶¼ÄÜ´¦Àíº¯ÊýδÐÞÊεÄÃû×Ö¡£È»¶ø£¬ÔÚÓÐЩÇé¿öÏ£¬Äã¿ÉÄÜÐèÒªÖ¸¶¨º¯ÊýµÄÐÞÊÎÃû¡£¶ÔÓÚC++ÖØÔغ¯ÊýºÍÌض¨µÄ³ÉÔ±º¯Êý£¨È磺¹¹Ô캯ÊýºÍÎö¹¹º¯Êý£©£¬Äã±ØÐëÖ¸¶¨ÕâЩº¯ÊýµÄÐÞÊÎÃû£¬ÒÔ±ãÁ¬½ÓÆ÷µÈ¹¤¾ßÄܹ»Æ¥ÅäÃû×Ö¡£Í¬Ê±£¬ÄãÒ²±ØÐëÔÚÄÇЩÒýÓÃc»òc£«£«º¯ÊýÃûµÄ»ã±àÔ´ÎļþÖÐʹÓÃÐÞÊÎÃû¡£
2¡¢²é¿´ÐÞÊÎÃû£º
Èç¹ûÄã±àÒëÁËÒ»¸öÔ´Îļþ£¬¸ÃÔ´ÎļþÖаüº¬Á˺¯Êý¶¨Òå»òÔÐÍ£¬Äã¿ÉÒÔ»ñµÃº¯ÊýµÄÐÞÊÎÃûÐÎʽ¡£
(1)ÓñàÒëÆ÷ÁÐ±í£¨compiler listing£©À´²é¿´£º
(i)ͨ¹ý½«ÁбíÎļþÀàÐͱàÒëÆ÷Ñ¡Ïî(/FA[c|s]) ÉèÖÃΪÏÂÃæÖеÄÒ»ÖÖ£¬À´²úÉúÁбíÎļþ£ºAssembly with Machine Code (/FAc); Assembly with Source Code (/FAs); Assembly, Machine Code, and Source (/FAcs).
(ii)ÔÚ²úÉúµÄÁбíÎļþÖУ¬ÕÒµ½°üº¬Î´¾ÐÞÊεĺ¯Êý¶¨ÒåµÄÐС£
(iii)²éÕÒÇ°ÃæÒ»ÐС£PROC NEAR ÃüÁî±êÇ©Ç°¾ÍÊǺ¯ÊýÃû¾¹ýÐÞÊκóµÄÐÎʽ¡£
(2)ʹÓÃDUMPBIN¹¤¾ßÀ´²é¿´£º
ÔÚ.OBJ»ò.LIBÉÏÔËÐÐ DUMPBIN£¬Ê¹ÓÃ/SYMBOLSÑ¡Ïî¡£ÔÚÊä³öÖвéÕÒδ¾ÐÞÊεĺ¯Êý¶¨Òå¡£ºóÃæ¸ú×ŵľÍÊǾ¹ýÐÞÊεĺ¯ÊýÃû£¬ÓÃÔ²À¨ºÅÀ¨ÆðÀ´µÄ¡£
¶þ¡¢Ìæ´úÁ¬½Ó˵Ã÷£º
Èç¹ûÔÚc++Öбàдһ¸ö³ÌÐòÐèÒªÓõ½cµÄ¿â£¬ÄǸÃÈçºÎ£¿Èç¹ûÕâÑùÉùÃ÷Ò»¸öcº¯Êý£º
void f(int a,char b);
c++±àÒëÆ÷¾Í»á½«Õâ¸öÃû×Ö±ä³ÉÏàÓ¦µÄÐÞÊÎÃû£¬±ÈÈ磺?f@@YAXHD@Z¡£
È»¶ø£¬c±àÒëÆ÷±àÒëµÄ¿âµÄÄÚ²¿º¯ÊýÃû£¨Á¬½ÓÆ÷ʹÓã©ÊÇÍêÈ«²»Í¬µÄ¡£ÕâÑù£¬µ±c++Á¬½ÓÆ÷Á¬½ÓcµÄº¯Êý¿âʱ£¬½«»á²úÉúÄÚ²¿Ê¹Óú¯Êý²»Æ¥Åä¡£
¹Ê£¬c++ÖÐÌṩÁËÒ»¸öÌæ´úÁ¬½Ó˵Ã÷(alternate linkage specification)£¬ËüÊÇͨ¹ýÖØÔØextern¹Ø¼ü×ÖÀ´ÊµÏֵġ£
externºó¸úÒ»¸ö×Ö·û´®À´Ö¸¶¨ÏëÉùÃ÷µÄº¯ÊýµÄÁ¬½ÓÀàÐÍ£¬ºóÃæÊǺ¯ÊýÉùÃ÷,±ÈÈ磺
extern "C" void f(int a,char b);
ÕâÑù£¬¾ÍÊǸæËß±àÒëÆ÷ÊÇcÁ¬½Ó£¬ÕâÑù¾Í²»»áת»»º¯ÊýÃûÁË¡£´ËÀýÖУ¬±àÒëºóµÄÄÚ²¿º¯ÊýÃûÊÇ_f¡£
Ïà¹ØÎĵµ£º
¡¡¡¡¾µäc³ÌÐò100Àý==1--10
¡¾³ÌÐò1¡¿
ÌâÄ¿£ºÓÐ1¡¢2¡¢3¡¢4¸öÊý×Ö£¬ÄÜ×é³É¶àÉÙ¸ö»¥²»ÏàͬÇÒÎÞÖظ´Êý×ÖµÄÈýλÊý£¿¶¼ÊǶàÉÙ£¿
1.³ÌÐò·ÖÎö£º¿ÉÌîÔÚ°Ùλ¡¢Ê®Î»¡¢¸öλµÄÊý×Ö¶¼ÊÇ1¡¢2¡¢3¡¢4¡£×é³ÉËùÓеÄÅÅÁкóÔÙÈ¥
¡¡¡¡¡¡¡¡¡¡¡¡µô²»Âú×ãÌõ¼þµÄÅÅÁС£
2.³ÌÐòÔ´´úÂ룺
main()
{
int i,j,k;
printf("\n");
for(i=1;i<5; ......
ÕâƪÎÄÕºܳ¤£¬×ªÔØÏÂÀ´¹©×Ô¼ºÂýÂýѧϰ¡£
±à³ÌÐÞÑø £¨×÷Õߣº³Â𩣩
————
ʲôÊǺõijÌÐòÔ±£¿ÊDz»ÊǶ®µÃºÜ¶à¼¼Êõϸ½Ú£¿»¹ÊǶ®µ×²ã±à³Ì£¿»¹ÊDZà³ÌËٶȱȽϿ죿
ÎÒ¾õµÃ¶¼²»ÊÇ¡£¶ÔÓÚһЩ¼¼Êõϸ½ÚÀ´ËµºÍµ×²ãµÄ¼¼Êõ£¬Ö»Òª¿´°ïÖú£¬²é×ÊÁϾÍÄÜÕÒµ½£¬¶Ô
ÓÚËٶȿ죬ֻҪ±àµÃ¶àÒ²¾ÍÊìÄÜÉúÇÉÁË¡ ......
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#define MAX 1024
int get_file_count(char *root)
{
DIR *dir;
struct dirent * ptr;
int total = 0;
char path[MAX];
dir = opendir(root ......
¼Ù¶¨¾¹ýÁËÈô¸ÉÄêµÄÑݽø£¬ IT¼¼Êõ·¢Õ¹µ½ÁËÕâÖ̶ֳȣº
1) ÁªÍø£º ËæʱËæµØÓÐÎÞÏÞ´óµÄ´ø¿í£¬ Óû§¿ÉÒÔÍêÈ«Ãâ·ÑʹÓÃÍøÂ磬 ÒÔ¼°ÎÞÏßÍøÂç100%µÄ¸²¸ÇÂÊ£»
2£©PCÐÔÄÜ£ºÃ¿Ì¨µçÄÔ¶¼ÓÐ×ã¹»µÄÄڴ棬 ×ã¹»¿ìµÄCPU£» ÔÚÓÀ¾Ã´æ´¢ÁìÓò³öÏÖ¸ïÃüÐÔ¼¼Êõ£¬ ¼´·ÃÎÊÍⲿ´æ´¢Ê±¼äºÍ·ÃÎÊÄÚ´æʱ¼äÔÚͬһÊýÁ¿¼¶£»
3£© B/S¿ª·¢¼¼Êõ£º ´óÁ¿³ÉÊìµÄwe ......