C/C++³ÌÐòÄÚ´æÖÐÊý¾Ý´æ´¢Çø·ÖÀà
ÔÚC/C++ÖУ¬ÄÚ´æÖÐÊý¾Ý´æ´¢·Ö³É4¸öÇø£¬·Ö±ðÊǶѡ¢Õ»¡¢È«¾Ö/¾²Ì¬´æ´¢ÇøºÍ³£Á¿´æ´¢Çø¡£
Õ»(stack)£¬¾ÍÊÇÄÇЩÓɱàÒëÆ÷ÔÚÐèÒªµÄʱºò·ÖÅ䣬ÔÚ²»ÐèÒªµÄʱºò×Ô¶¯Çå³ýµÄ±äÁ¿µÄ´æ´¢Çø¡£ÀïÃæµÄ±äÁ¿Í¨³£ÊǾֲ¿±äÁ¿¡¢º¯Êý²ÎÊýµÈ¡£
¶Ñ(heap)£¬Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ¡£
È«¾Ö/¾²Ì¬´æ´¢Çø£¬È«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿±»·ÖÅ䵽ͬһ¿éÄÚ´æÖУ¬ÔÚÒÔÇ°µÄCÓïÑÔÖУ¬È«¾Ö±äÁ¿ÓÖ·ÖΪ³õʼ»¯µÄ(DATA¶Î)ºÍδ³õʼ»¯µÄ(BSS¶Î)£¬ÔÚC++ÀïÃæûÓÐÕâ¸öÇø·ÖÁË£¬ËüÃǹ²Í¬Õ¼ÓÃͬһ¿éÄÚ´æÇø¡£
³£Á¿´æ´¢Çø£¬³£Á¿×Ö·û´®¾ÍÊÇ·ÅÔÚÕâÀïµÄ£¬²»ÔÊÐíÐÞ¸Ä(ͨ¹ý·ÇÕýµ±ÊÖ¶ÎÒ²¿ÉÒÔÐ޸ģ¬¶øÇÒ·½·¨ºÜ¶à)£¬³ÌÐò½áÊøºóÓÉϵͳÊÍ·Å¡£
|----------------------|
| ÄÚºËÐéÄâ´æ´¢Æ÷ |
|----------------------|
| Óû§Õ»(Statk) |
|----------------------|
| | |
| \ / |
| |
| / \ |
| | |
|----------------------|
| ¶Ñ(Heap) |
|----------------------|
| δ³õʼ»¯(BSS) |
|----------------------|
| ³õʼ»¯(Data) |
|----------------------|
| ÕýÎĶÎ(Text |
|-----
Ïà¹ØÎĵµ£º
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......
Delphi Óë C/C++ Êý¾ÝÀàÐͶÔÕÕ±í
DelphiÊý¾ÝÀàÐÍC/C++
ShorInt
8λÓзûºÅÕûÊý
char
Byte
8λÎÞ·ûºÅÕûÊý
BYTE,unsigned short
SmallInt
16λÓзûºÅÕûÊý
short
Word
16λÎÞ·ûºÅÕûÊý
unsigned short
Integer,LongInt
32λÓзûºÅÕûÊý
int,long
Cardinal,LongWord/DWORD
32λÎÞ·ûºÅÕûÊý
unsigned long
Int6 ......
¡¾³ÌÐò1¡¿
ÌâÄ¿£ºÓÐ1¡¢2¡¢3¡¢4¸öÊý×Ö£¬ÄÜ×é³É¶àÉÙ¸ö»¥²»ÏàͬÇÒÎÞÖظ´Êý×ÖµÄÈýλÊý£¿¶¼ÊǶàÉÙ
£¿
1.³ÌÐò·ÖÎö£º¿ÉÌîÔÚ°Ùλ¡¢Ê®Î»¡¢¸öλµÄÊý×Ö¶¼ÊÇ1¡¢2¡¢3¡¢4¡£×é³ÉËùÓеÄÅÅÁкóÔÙÈ¥
¡¡¡¡¡¡¡¡¡¡¡¡µô²»Âú×ãÌõ¼þµÄÅÅÁС£
2.³ÌÐòÔ´´úÂ룺
main()
{
int i,j,k;
printf("\n");
for(i=1;i<5;i++)¡¡¡¡¡¡¡¡£¯*ÒÔÏ ......