C/C++»ù±¾Êý¾ÝÀàÐÍ
ÁËCÈ»ºóC++£¬È»ºóMFC/Windows,È»ºóÊÇC#,ÆäÖÐÊý¾ÝÀàÐͺܶ࣬ÓÉ»ù±¾ÀàÐÍÑÜÉúµÄtypedefÀàÐÍÒ²N¶à¡£ÊìÖª»ù±¾Êý¾ÝÀàÐÍÊÇÎÒÃÇÕýÈ·±í´ïʵ¼ÊÎÊÌâÖи÷ÖÖÊý¾ÝµÄÇ°ÌᣬÒò´ËÎÒ·ÖÀà×ܽáÁËÒ»ÏÂC/C++/Windows /C#»ù±¾Êý¾ÝÀàÐÍ£¬ÒÔ±ãÈÕºó²éÔÄ¡£
ANSI C/C++»ù±¾Êý¾ÝÀàÐÍ£º
Type
Size
ÊýÖµ·¶Î§
ÎÞÖµÐÍvoid
0 byte
ÎÞÖµÓò
²¼¶ûÐÍbool
1 byte
true false
ÓзûºÅ¶ÌÕûÐÍshort [int] /signed short [int]
2 byte
-32768~32767
ÎÞ·ûºÅ¶ÌÕûÐÍunsigned short [int]
2 byte
0~65535
ÓзûºÅÕûÐÍint /signed [int]
4 byte
-2147483648~2147483647
ÎÞ·ûºÅÕûÐÍunsigned [int]
4 byte
0~4294967295
ÓзûºÅ³¤ÕûÐÍlong [int]/signed long [int]
4 byte
-2147483648~2147483647
ÎÞ·ûºÅ³¤ÕûÐÍunsigned long [int]
4 byte
0~4294967295
long long
8 byte
0~18446744073709552000
ÓзûºÅ×Ö·ûÐÍchar/signed char
1 byte
-128~127
ÎÞ·ûºÅ×Ö·ûÐÍunsigned char
1 byte
0~255
¿í×Ö·ûÐÍwchar_t (unsigned short.)
2 byte
0~65535
µ¥¾«¶È¸¡µãÐÍfloat
4 byte
-3.4E-38~3.4E+38
Ë«¾«¶È¸¡µãÐÍdouble
8 byte
1.7E-308~1.7E+308
long double
8 byte
˵Ã÷£º
£¨1£©ÀàÐÍÐÞÊηûsignedºÍunsignedÓÃÓÚÐÞÊÎ×Ö·ûÐͺÍÕûÐΡ£
£¨2£©ÀàÐÍÐÞÊηûshortºÍlongÓÃÓÚÐÞÊÎ×Ö·ûÐͺÍÕûÐΡ£
£¨3£©µ±ÓÃsignedºÍunsigned¡¢shortºÍlongÐÞÊÎintÕûÐÎʱ£¬int¿ÉÊ¡ÂÔ¡£
£¨4£©ÆäÖÐboolºÍwchar_tÊÇC++ÌØÓеġ£
£¨5£©³ýÉϱíÒÔÍ⣬C/C++¶¼¿ÉÒÔ×Ô¶¨Òåö¾Ùenum¡¢ÁªºÏunionºÍstruct½á¹¹ÌåÀàÐÍ¡£
£¨6£©ÒÔÉÏsizeofͨ¹ýWindows XP 32λƽ̨²âÊÔ£¬ÆäÖÐijЩÀàÐÍÊý¾ÝµÄ×Ö½ÚÊýºÍÊýÖµ·¶Î§ÓɲÙ×÷ϵͳºÍ±àÒëƽ̨¾ö¶¨¡£±ÈÈç16λ»úÉÏ£¬sizeof(int) = 2£¬¶ø32λ»úÉÏsizeof(int) = 4£»32λ»úÉÏsizeof(long) = 4£¬¶ø64λ»úÉÏsizeof(long) = 8¡£³ý´ËÖ®Í⣬עÒâ64λ»úÉϵÄpointerÕ¼8byte¡£
£¨7£©voidµÄ×ÖÃæÒâ˼ÊÇ“ÎÞÀàÐÍ”£¬²»ÄÜÓÃÀ´¶¨Òå±äÁ¿¡£voidÕæÕý·¢»ÓµÄ×÷ÓÃÔÚÓÚ£º<1> ¶Ôº¯Êý·µ»ØºÍº¯Êý²ÎÊýµÄÏÞ¶¨£¬ÀýÈç×Ô¶¨Òå¼È²»´ø²ÎÊýÒ²ÎÞ·µ»ØÖµµÄº¯Êývoid MyFunc(void);<2>¶¨ÒåÎÞÀàÐÍͨÓÃÖ¸Õëvoid *£¬Ö¸ÏòÈκÎÀàÐ͵ÄÊý¾Ý¡£
£¨8£©±ê×¼C++¿â¼°STL»¹ÌṩÁËͨÓÃÊý¾Ý½á¹¹£º×Ö·û´®Ààstring£»ÏòÁ¿ÀàÄ£°åvector£»Ë«¶Ë¶ÓÁÐÀàÄ£°ådeque£»Á´±íÀàÄ£°ålist£»ÈÝÆ÷ÊÊÅäÆ÷¶Ñ
Ïà¹ØÎĵµ£º
C/C++µ×²ãʵÏÖÖ¸¶¨´ÅÅÌÖ»¶Á ÊÕ²Ø
Ñà¿ñͽдµÄÇý¶¯¹Ò¹³£¬ÏÞÖÆ´ÅÅÌÖ»¶Á£¬ ÓÃÓÚ±£Ö¤ÉæÃܼÆËã»úµÄÎȶ¨£¬Ï൱ÓÚ½«´ÅÅ̱ä³ÉROM #include "ntddk.h"
#include
#include #define DRIVERNAME "OnlyRead(GongXiPeng!)" // for use in messages typedef struct tagDEVICE_EXTEN ......
×î½üʵÔÚÊÇ̫æÁË£¬ÕâƪÕûÕû¾ÍÍƳÙÁË1¸öÔÂÁË£¬ÊµÔÚÊǶԲ»Æð¡£Ö®Ç°±¾´òËãÕâ¸öÄ£¿é¾Í½áÊøÁË£¬Îļþ²Ù×÷¾Í²»Ð´ÁË£¬µ«ÊÇÎļþ²Ù×÷ÓÖÊÇÒ»¸öºÜÖØÒªµÄ¶«Î÷£¬¶øÇÒÒ²¸ÕºÃÄܹ»×ܽá֮ǰÎÒÃÇѧϰµÄËùÓÐ֪ʶ¡£Í¬Ê±Ò²ÎªÁ˽«Îļþ²Ù×÷Õâ¸ö³õѧÕßÈÏΪºÜÉñÃصĶ«Î÷¸ø±¾ÖÊ»¯¡£Òò´Ë£¬±¾Æª½«ÖðÒ»½éÉÜCÓïÑÔµÄÎļþ²Ù×÷¡££¨±¾Ä£¿éµÄÃüÃû±¾À´ÊÇÏëC\C++Ò ......
¸ÅÄαËæ»úÊý¡¢ÖÖ×ÓÒÔ¼°CÖеÄËæ»úº¯Êý
2007Äê12ÔÂ03ÈÕ ÏÂÎç 02:28
Ê×ÏÈÐèÒªÉùÃ÷µÄÊÇ£¬¼ÆËã»ú²»»á²úÉú¾ø¶ÔËæ»úµÄËæ»úÊý£¬¼ÆËã»úÖ»ÄܲúÉú“αËæ»úÊý”¡£Æäʵ¾ø¶ÔËæ»úµÄËæ»úÊýÖ»ÊÇÒ»ÖÖÀíÏëµÄËæ»úÊý£¬¼´Ê¹¼ÆËã»úÔõÑù·¢Õ¹£¬ËüÒ²²»»á²úÉúÒ»´®¾ø¶ÔËæ»úµÄËæ»úÊý¡£¼ÆËã»úÖ»ÄÜÉú³ÉÏà¶ÔµÄËæ»úÊý£¬¼´Î±Ëæ»úÊý¡£
......
1. ±äÁ¿²»×ö³õʼ»¯¡£
2. ·ÖÅäµÄ¶ÔÏó²»×öÏú»Ù¡£Ò»¸öºÃµÄÏ°¹ß¾ÍÊÇ£¬Ã¿Éú³ÉÒ»¸öÀàʱ£¬¾Í×Ô¶¯Ð´Ò»¸ö×Ô¼ºµÄInitInstanceMember,ºÍ ReleaseInstanceMember()·½·¨¡£
3. °üµÄ·ÖÀ࣬Èç¹û×Ô¼º²»×ösourceµÄÂß¼·ÖÀ࣬C++»·¾³Ò»°ãÊDz»»á×Ô¼º×öµÄ¡£Õâ¸ö¸úJavaÖеÄpackageºÍÎļþÎïÀíÉÏ´æ´¢·½Ê½Ò»ÖÂÊDz»Ò»ÑùµÄ¡£
C++ ......
1¡¢Java²ÉÓÃUnicode×Ö·û¼¯£¬Ôö¼ÓÁ˶ԷÇÀ¶¡ÓïϵµÄÖ§³Ö£¬Ò»¸öºº×Ö¿ÉÒÔÖ±½Ó×÷Ϊһ¸ö×Ö·û³£Á¿½øÐи³Öµ¶øÔÚC++ÖбØÐë×öΪ×Ö·û´®´¦Àí
char chTemp = 'ÎÒ';
System.out.println(chTemp);
Java×Ö·ûÊÇÒ»¸ö16ΪµÄÎÞ·ûºÅÕûÊý£¬C++ÖÐΪ8λ
2. Java±êʶ·û¿ÉÒÔÒÔÃÀÔª·û$¿ªÍ·£¬¿Éº¬ÓÐËùÓÐÊ®Áù½øÖÆÖµ´óÓÚ0xc0µ ......