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

C ºÍ C++ ×Ö·û´®×ÖÃæÁ¿

C ºÍ C++ ×Ö·û´®×ÖÃæÁ¿£¨String Literal£©¼ÈÓÐÏà֮ͬ´¦£¬ÓÖÓÐһЩÇø±ð¡£Á˽âÕâЩÄÚÈݶÔÓÚ¼ÓÉî×Ö·û´®×ÖÃæÁ¿ÒÔ¼°Ïà¹ØһЩ¸ÅÄîµÄÀí½â¡¢³ÎÇåһЩ³£¼ûµÄ¸ÅÄîÎóÇø²»ÎÞÖúÒæ¡£±¾ÎÄÒÔÆÕͨ×Ö·û´®×ÖÃæÁ¿ "hello" ΪÀý×ܽá˵Ã÷ÈçÏ¡£
Ïàͬµã£º
×Ö·û´®×ÖÃæÁ¿ÊǶÔÏó
C/C++ ÖеĶÔÏó£¨Object£©Ö¸µÄÊÇÒ»¿é´æ´¢Çø¡£×Ö·û´®×ÖÃæÁ¿ÊDz»ÐèÒª´´½¨¹ý³Ì¾Í¿ÉʹÓõĶÔÏó£¬ËùÒÔËü¼ÈûÓбäÁ¿ÄÇÑùµÄÉùÃ÷»òÕ߶¨Ò壨×Ö·û´®×ÖÃæÁ¿ÊÇÎÞÃû¶ÔÏ󣩣¬Ò²²»ÐèÒªÏó¶¯Ì¬·ÖÅäµÄ¶ÔÏóÄÇÑù½øÐж¯Ì¬·ÖÅä¡£ÓÉÓÚÕâ¸öÔ­Òò£¬ÓÃÀ´ÏÞ¶¨±äÁ¿µÄÀàÐÍÏÞ¶¨·û£¨Èç const¡¢volatile£©ÒÔ¼°´æ´¢Àà±ðָʾ·û£¨Èç extern¡¢static¡¢auto¡¢register£©²»ÄÜÓÃÔÚÐÞÊÎ×Ö·û´®×ÖÃæÁ¿ÉÏ¡£
Êý×éÀàÐÍ
×Ö·û´®×ÖÃæÁ¿ÊÇÊý×éÀàÐ͵ĶÔÏó£¬Òò¶ø¾ßÓÐÊý×éµÄÒ»ÇÐÌص㡣¹ØÓÚÕâÒ»µãÔÚÏÂÃ滹»á½øÒ»²½ËµÃ÷¡£
¾²Ì¬´æ´¢ÆÚ
C/C++ ÖжÔÏóµÄÉú´æÆÚ°´ÕÕÆä´æ´¢ÐÔÖÊ¿É·ÖΪÈýÀࣺ¾²Ì¬´æ´¢ÆÚ£¨static storage duration£©¡¢×Ô¶¯´æ´¢ÆÚ£¨automatic storage duration£©ÒÔ¼°¶¯Ì¬´æ´¢ÆÚ£¨dynamic storage duration£©¡£ÏàÓ¦µØ£¬¶ÔÏó¿É¸ù¾Ý´æ´¢ÆÚÐÔÖÊ·ÖΪ¾²Ì¬¶ÔÏó¡¢×Ô¶¯¶ÔÏóºÍ¶¯Ì¬¶ÔÏóÈýÖÖ¡£
×Ö·û´®×ÖÃæÁ¿ÊǾ²Ì¬¶ÔÏó£¬ËùÒÔÔÚ³ÌÐòÔËÐÐÆÚ¼ä»áÒ»Ö±´æÔÚ¡£
×Ö·û´®×ÖÃæÁ¿ÊÇ×óÖµ£¬¶øÇÒÊDz»¿É±»¸ü¸ÄµÄ×óÖµ
ÀýÈ磬char s[] = "hello"; ÖÐµÄ “hello” ÊÇÊý×éÀàÐ͵Ä×óÖµ£¨lvalue£©£¬ÓÃÓÚ³õʼ»¯ s Êý×飻sizeof( "hello" ) ÒÔ¼° &"hello" ÖÐµÄ "hello" Ò²¶¼ÊÇ×óÖµ¡£ÔÚÕâЩÇé¿öÏ£¬"hello" ´¦ÓÚ×óÖµÓïÒåÉÏÏÂÎÄ»·¾³ÖУ¬ËùÒÔ²»»á²úÉúÏÂÃ潫ҪÌáµ½µÄÊý×éת»»ÎªÖ¸ÕëµÄÏÖÏó¡£
ÁíÍ⣬ÓÐЩÔËËã²»µ«ÒªÇóÆä²Ù×÷ÊýÊÇ×óÖµ£¬»¹ÒªÇó¿É±ä¡£ÀýÈ磬¶Ô¶ÔÏó½øÐи³Öµ¡¢×Ô¼Ó¡¢×Ô¼õµÈÔËËã¡£ÒòΪÊý×éÊDz»¿É±»¸ü¸ÄµÄ×óÖµ£¬ËùÒÔ²»ÄܶÔÊý×é½øÐÐÕâЩ²Ù×÷£¬Ò²¾ÍÊÇ˵²»´æÔÚÊý×éÀàÐ͵ĸ³Öµ¡¢×Ô¼Ó¡¢×Ô¼õµÈÔËËã¡£
×Ö·û´®×ÖÃæÁ¿¿ÉÒÔת»»ÎªÖ¸ÏòÆäÊ×µÚÒ»¸ö×Ö·ûµÄÖ¸Õë
´¦ÓÚÓÒÖµÓïÒå»·¾³ÖеÄ×Ö·û´®×ÖÃæÁ¿½«±»Ä¬ÈÏת»»ÎªÖ¸ÏòµÚÒ»¸ö×Ö·ûµÄÖ¸Õë¡£ÀýÈ磬char* p = "hello"; ÖÐµÄ “hello” ÔÚת»»Îª×Ö·ûÖ¸ÕëºóÓÃÓÚ³õʼ»¯Ö¸Õë±äÁ¿ p£»±í´ïʽ "hello"[0]£¨Ï൱ÓÚ *("hello" + 0) »òÕß *"hello"£©ÖÐµÄ “hello” Ò²ÊÇͬÑùת»»ÎªÖ¸Õëºó²ÎÓëϱêÔËË㣬µÈµÈ¡£
ÕâÖÖÐÔÖÊÒ²ÊÇÊý×éÀàÐ͵ÄÌص㡣ÔÚÓÒÖµÓïÒå»·¾³Ï£¬Ò»°ãÀàÐ͵ĶÔÏó±íʾµÄÖµÊÇÓÉÆä´æ´¢ÄÚÈݾö¶¨µÄ£»¶øÊý×éÀàÐ͵ĶÔÏóÓë´Ë²»Í¬£¬Ëü´ú±íµÄÖµ²»ÊÇÀ´Ô´ÓÚÆäÄÚÈÝ£¬¶øÊÇÀ´Ô´ÓÚÊý×é¶ÔÏóÊ×ÔªËØËùÔڵĵØÖ·¡£ÕâÊÇÊý×é×îΪÌØÊâµÄµØ


Ïà¹ØÎĵµ£º

ÔÚÆÁÄ»ÉÏ»­Í¼µÄC££ÊµÏÖ´úÂë


DllImportËùÔÚµÄÃû×Ö¿Õ¼ä using System.Runtime.InteropServices;
[DllImport("User32.dll")]
        public extern static System.IntPtr GetDC(System.IntPtr hWnd);   
        private void button19_Click(obj ......

CÓëC++µÄÇø±ð

1. C++ËäÈ»Ö÷ÒªÊÇÒÔCµÄ»ù´¡·¢Õ¹ÆðÀ´µÄÒ»ÃÅÐÂÓïÑÔ£¬µ«Ëý²»ÊÇCµÄÌæ´úÆ·£¬²»ÊÇCµÄÉý¼¶£¬C++ºÍCÊÇÐֵܹØϵ¡£Ã»ÓÐË­±ÈË­ÏȽøµÄ˵·¨£¬¸üÖØÒªµÄÒ»µãÊÇCºÍC++¸÷×Եıê׼ίԱ»áÊǶÀÁ¢µÄ£¬×îеÄC++±ê×¼ÊÇC++98£¬×îеÄC±ê×¼ÊÇC99¡£Òò´ËҲûÓÐÏÈѧCÔÙ˵C++µÄ˵·¨£¬Ò²²»ÔÙ£¨×¢ÒâÕâ¸ö"²»ÔÙ"£©ÓÐC++Óï·¨ÊÇCÓï·¨µÄ³¬¼¯µÄ˵·¨¡£
2. C++/CL ......

´¿CʵÏÖc++Àà

//#include "stdafx.h"
/*
ÃèÊö:´¿cÄ£ÄâÀà,´¿c±àдc++Àà,´¿cʵÏÖc++ÀàµÄ¼òµ¥·¶Àý,½á¹¹Ä£ÄâÀà,struct ±àдclass.
c±àдÀàÊÇʵÏÖ´¿c±àдcom×é¼þµÄ»ù´¡¡£
*/
#include <stdio.h>
typedef struct _Vtbl
{
    void (*AddRef)(struct CObject* obj,int);//ËùÓеĺ¯ÊýµÄµÚÒ»¸ö²ÎÊýÀàËÆclassµÄÒþÄäµÄ ......

³£ÓÃCÍ·Îļþ¼°ÆäÔÚ±ê×¼C++Öеı£Áô

Í·ÎļþµÄ×÷ÓÃ
ÔçÆڵıà³ÌÓïÑÔÈçBasic¡¢Fortran ûÓÐÍ·ÎļþµÄ¸ÅÄC++/C ÓïÑԵijõѧÕßËäÈ»»áÓÃʹÓÃÍ·Îļþ£¬µ«³£³£²»Ã÷ÆäÀí¡£ÕâÀï¶ÔÍ·ÎļþµÄ×÷ÓÃÂÔ×÷½âÊÍ£º
£¨1£©Í¨¹ýÍ·ÎļþÀ´µ÷Óÿ⹦ÄÜ¡£ÔںܶೡºÏ£¬Ô´´úÂë²»±ã£¨»ò²»×¼£©ÏòÓû§¹«²¼£¬Ö»ÒªÏòÓû§ÌṩͷÎļþºÍ¶þ½øÖƵĿ⼴¿É¡£Óû§Ö»ÐèÒª°´ÕÕÍ·ÎļþÖеĽӿÚÉùÃ÷À´µ÷Óÿ⹦ ......

C/C++ÖÐnearºÍfarµÄÇø±ð

C/C++ÖÐnearºÍfarµÄÇø±ð
      ¹Ø¼ü×ÖnearºÍfarÊÜÄ¿±ê¼ÆËã»úÌåϵ½á¹¹µÄÓ°Ï졣Ŀǰ±à³ÌÖÐʹÓò»¶à¡£
      near¹Ø¼ü×Ö´´½¨Ò»¸öÖ¸Ïò¿ÉÑ°Ö·ÄÚ´æµÍ¶Ë²¿·ÖµÄÄ¿±êÖ¸Õë¡£ÕâЩָÕëÕ¼ÓÃÄÚ´æµÄµ¥Ò»×Ö½Ú£¬²¢ÇÒËûÃÇÄܹ»Ö¸ÏòµÄÄÚ´æµ¥Ôª±»ÏÞÖƵ½256¸öλÖã¬Í¨³£ÊÇÔÚ0x0000~0x00ff·¶Î ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ