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

CºÍC++µÄµãµÎ»ýÀÛ£¨1£©

                     CºÍC++µÄµãµÎ»ýÀÛ£¨1£©
1. mfc ±à³ÌÖдæÔÚ×ÅÈç¹û³öÏÖ“ÄÚ´æ²»×㔵ĶԻ°¿ò£¬Ò»ÖÖÇé¿öÊÇÔÚÉêÇëÄÚ´æµÄʱºò³öÏÖÎÊÌ⣬Ҳ¾ÍÊÇÀýÈ磺char *pChar = new char[num]; µ«´Ëʱnum ΪÁã»òÕ߸ºÊýµÄÇé¿ö¡£
2 .λÔËËãÖ»ÊÇÓÃÓÚchar ºÍint Á½ÖÖÀàÐÍ£¬²»ÊÊÓÃÓÚdouble,float,long double,void ÀàÐÍ¡£
3.    ÒÆÎ»²Ù×÷£¬ÔÚÒÆÎ»ºóÊýֵСÓÚ256 µÄ·¶Î§ÄÚ£¬Ïò×óÒÆ¶¯ÒÆÎ»ÔòÊdzË2 £¬ÏòÓÒÒÆ¶¯Ò»Î»ÔòÊdzý2
B = a<<2  µ±a*4 >256 µÄʱºò£¬B = a*4 – 256; µ± a*4<256 µÄʱºò£¬B = a*4;
 
4.      string ÀàʹÓõķ½·¨
£¨1£©       Ê×ÏÈÒýÓÃÍ·Îļþ#include <string>
        £¨2£©    ÔÚʹÓÃstring µÄʱºòʹÓÃÃüÃû¿Õ¼ästd £»»òÕßÉùÃ÷using namespace std;
5. ÔÚVC µ±ÖУ¬Èç¹ûÊÇijһ¸ö¹¤³ÌÐèÒª±»µ¼³ö¹©ÆäËü¹¤³ÌʹÓã¬ÐèÒª¼Óµ¼³ö±ê×¼__declspec(dllExport). Èç¹û²»Ìí¼ÓÉÏÊö±êÖ¾·û£¬±ã²»Äܵ¼³ö£¬ÆäËû¹¤³Ì±ã²»ÄÜʹÓá£Èç¹ûÊDZ¾¹¤³ÌÐèҪʹÓÃÆäËü¹¤³ÌÖеÄÄÚÈÝ£¬ÐèÒª¼ÓÉÏ__declspec(dllImport). ËäÈ»Ãæ¶ÔÒ»°ãº¯ÊýºÍ¾²Ì¬º¯Êý²»¼Ó±êÖ¾·û¿ÉÒÔͨ¹ý£¬µ«ÊÇÃæ¶Ô¾²Ì¬±äÁ¿µÄʱºò±ã»á³öÏÖÁ¬½Ó´íÎó¡£
6. Struct ÄÚ²¿µÄ³ÉÔ±ºÍÈ«¾Ö±äÁ¿µ±Ãû×ÖÏàͬµÄʱºò£¬²»»á²úÉú³åÍ»£¡
7.      ÔÚVC ÏÂÃæ½øÐбàÒëµÄ¹ý³ÌÖУ¬ÏÈÒªÉú³ÉÖмäÎļþ£¬ÔÚÖмäÎļþµÄ»ù´¡ÉÏÉú³É¿ÉÖ´ÐлòÕßÊÇ¿âÎļþ¡£
 
8.É±´ºÍdz¿½±´µÄÎÊÌâ£ºÇø±ðÊÇÄã´«µÝµÄÊǵØÖ·»¹ÊÇÖµ£¬Èç¹û´«µÝµÄÊǵØÖ·µÄ»°±ãÊÇdz¿½±´£¬´«µÝµÄÊÇÖµµÄ»°±ãÊÇÉ±´¡£Ç³¿½±´µÄʱºòµ±±äÁ¿ÊÇNEW ³öÀ´ÔÚ½øÐÐɾ³ýµÄʱºòÒ»¶¨Òª×¢Òâ¡£
 
9. ʹÓà Malloc\Free ºÍ New\delete µÄ²»Í¬£º
     ÔÚÉú³É¶ÔÏóµÄʱºò£¬Í¨¹ý Malloc Éú³ÉµÄ£¬»¹±ØÐëÒªµ÷Óù¹Ô캯Êý²Å¿ÉÒÔ½øÐгõʼ»¯£¬É¾³ýµÄʱºò£¬ÏÈÊǵ÷ÓÃÎö¹¹º¯Êý£¬ÔÙ Free £¨£©µô£¨ free ²»ÄÜÖ´ÐÐÎö¹¹º¯Êý£¬¶ø¿ÉÄÜÔì³ÉһЩÎÊÌâµÄ´æÔÚ £©¡£¶ø New ºó£¬ÏµÍ³×Ô¼ºµ÷Óù¹Ôì¡¢Îö¹¹º¯Êý£¬²»ÓÃÔÚ½øÐе÷Óã¬Ö»ÐèÒª Delete ¼´¿É¡£ ÔÚɾ³ýÊý×éµÄʱºò£¬ delete [] pData; ¶ø²»ÊÇ Delete pData £»·ñÔòɾ³ýµÄ½ö½öÊǵÚÒ»¸öÔªËØ¡£
 
1£©  ·ÖÅäûÓгɹ¦¡£È´Ê¹ÓÃËü


Ïà¹ØÎĵµ£º

VC++ÓëJava

VC++ÓëJava
Visual C++ 6.0ÊÇ΢Èí·Ç³£¾­µäµÄµ÷ÊÔ¹¤¾ß£¬±¾È˷dz£Ï²»¶¡£²»Öª²»¾õѧÁËMFC£¬»¨Á˲»ÉÙʱ¼äÓëÒø×Ó£¬¸Ð¾õMFCÕæµÄÊDz©´ó¾«É¾ÍÏñÒ»Öַdz£¸ßÉîµÄÎ书£¬¾ÍÏñÌ«¼«£¬ÈëÃÅÄÑ¡£javaÏñÎäµ±¡£Visual C++ÐèÒª±È½ÏÉîºñµÄÄÚ¹¦²ÅÄÜÐÞÁ¶ºÃ£¬²»¹ýjavaѧºÃÁËÒ²²»´í£¬²»¹ÜѧÄĸö£¬×îÖյľ³½ç¶¼ÊǸÕÈáÏà¼Ã¡£Î书Èç´Ë£¬±à³ÌÓïÑÔ¿ª·¢ ......

C/C++ÄÚ´æ·ÖÅä


#include <iostream>
using namespace std;
void main()
{
 char *p,*q;
 p = "abcde";
 q = p + 3;
 *q = 't';
 cout<<p<<endl;
 cout<<q<<endl;
}
Á½ÖÖÓïÑÔ±àÒë¶¼¿ÉÒÔͨ¹ý
µ±Ö´Ðе½
 *q = 't';
ʱ£¬C++³ÌÐò³öÏÖÄÚ´æ·ÃÎÊ´íÎó£¬C³ÌÐò¿ÉÒ ......

cÊä³ö±ê×¼×ܽá

  CÊä³ö¸ñʽ×ܽá ÊÕ²Ø
CÊä³ö¸ñʽ×ܽá
 
1 Ò»°ã¸ñʽ
   printf(¸ñʽ¿ØÖÆ£¬Êä³ö±íÁУ©
   ÀýÈ磺printf("i=%d,ch=%c\n",i,ch);
   ˵Ã÷:
   (1)“¸ñʽ¿ØÖÆ”ÊÇÓÃ˫ƲºÅÀ¨ÆðÀ´µÄ×Ö·û´®£¬Ò²³Æ“ת»»¿ØÖÆ×Ö·û´®”£¬Ëü°üÀ¨Á½ÖÖÐÅÏ¢£º
 &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ