C·ÖÅäÄÚ´æ-º¯ÊýÃû - C/C++ / CÓïÑÔ
ÔÚC»òC++ÖУº1.
ûÓÐÓÃÀàµÄÇé¿öÏ ÊDz»ÊÇÍâÃæµÄº¯Êý¶¼ÊÇÈ«¾Öº¯Êý £¡Èç¹ûÊÇÈ«¾Öº¯Êý ÄÇôÔÚûµ÷Óú¯ÊýÇ°ÊÇÖ»¸øº¯ÊýÃû·ÖÅä¸öÖ¸Ïò¸Ãº¯ÊýÄÚ´æµÄµØÖ·Âð µ±µ÷Óà ¸Ãº¯Êýºó ÎÒÖªµÀÊǸøº¯ÊýÕ»·ÖÅä¿Õ¼ä µ±À뿪º¯ÊýºóÇå³ý
Èç¹ûÓÐÀà·â×°ºó ÊDz»ÊÇÔÚʵÀý»¯¸ÃÀàºó ¸øÀàÀïÃæµÄº¯ÊýÃû·ÖÅäÒ»¸öµØÖ· µ±µ÷Óøú¯Êýºó ¸øÕâ¸öµØÖ··ÖÅäÒ»¸ö¿Õ¼ä....
»òÊÇ
2.
ÒªÔÚµ÷Óú¯ÊýµÄʱºò ¸øº¯Êý·ÖÅäÒ»¸ö¿Õ¼äÈ»ºóÔÙ·µ»Ø¸Ã¿Õ¼äµÄµØÖ·¸øº¯ÊýÃû µ«ÊÇÈç¹ûÕâÑùµÄ»° Ϊʲô»áÓк¯ÊýÖ¸Õ룿
.......ÇëÈËÖ¸µã ÉÏÃæµÄÀí½âÊÇÄǸö »òÊǶ¼²»ÊÇ
º¯ÊýÖ¸ÕëÖ¸ÏòµÄÊÇ´úÂëÇøµÄµØÖ·
ÎÒº¹£¬£¬¿´µ½Â¥Ö÷µÄÌû×ÓÖªµÀÂ¥Ö÷ÏÖÔÚÓжà»ìÂÒ£¬£¬
Ö¸ÕëÊǸö±äÁ¿£¬ÀïÃæµÄÖµÊÇÒ»¸öµØÖ·£¬ÊÇÒ»¿éÄÚÔÚÇøÓòµÄÊ×µØÖ·£¨Ò²¿ÉÒÔ²»ÊÇÊ×µØÖ·£¬µ«´ó¶àÊýÇé¿ö¶¼ÕâÑù£©
º¯ÊýÖ¸ÕëÏ൱ÓÚº¯ÊýÃû Ö¸ÏòÆä´úÂëµÄµØÖ·
È«¾Öº¯Êý£º
±àÒëµÄʱºò£º ¸øº¯ÊýÃû¸³ÖµÖ¸Ïò¸Ãº¯Êý´úÂëµÄµØÖ· µ±µ÷Óøú¯Êýʱ ¸øº¯ÊýÃûËùÖ¸ÏòµÄ´úÂëÇøµÄ±äÁ¿·ÖÅä¿Õ¼ä ..... È»ºóÀ뿪º¯ÊýµÄʱɾ³ý
ÀàÀïÃæµÄ»°£º¾ÍÊÇʵÀý»¯ÀàµÄʱºò Ö´ÐÐ ¸øº¯ÊýÃû¸³ÖµÖ¸Ïò¸Ãº¯Êý´úÂëµÄµØÖ· È»ºóµ÷Óøú¯Êýʱ ¸øº¯ÊýÃûËùÖ¸ÏòµÄ´úÂëÇøµÄ±äÁ¿·ÖÅä¿Õ¼ä ..... È»ºóÀ뿪º¯ÊýµÄʱɾ³ý
ÕâÑùÂð
ËÄÂ¥ÒѾ˵ÁË
ÊDz»ÊÇÀàµÄº¯Êý³ýÁË·ÃÎÊʱÓÐȨÏÞÏÞÖÆÍâ
ÆäËûµÄûÓÐʲô±¾ÖÊÇø±ð
VCµ÷ÊÔʱ°´Alt+8,TC»òBCÓÃTDµ÷ÊÔ,´ò¿ª»ã±à´°¿Ú¿´Ã¿¾äC¶ÔÓ¦µÄ»ã±à²»¾Íɶ¶¼Ã÷°×ÁËÂð¡£
£¨Linux»òUnixÏÂÓ¦¸ÃÒ²¿ÉÒÔÔÚÓÃGDBµ÷ÊÔʱ,¿´Ã¿¾äC¶ÔÓ¦µÄ»ã±à¡££©
¼ÆËã»ú×é³ÉÔÀí¡úDOSÃüÁî¡ú»ã±àÓïÑÔ¡úCÓïÑÔ£¨²»°üÀ¨C++£©¡¢´úÂëÊéд¹æ·¶¡úÊý¾Ý½á¹¹¡¢±àÒëÔÀí¡¢²Ù×÷ϵͳ¡ú¼ÆËã»úÍøÂç¡¢Êý¾Ý¿âÔ
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......