Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c++

C/C++

9.2  ¹²ÓÃÌå
CÓïÑÔ³ýÁËÌṩ½á¹¹ÌåÕâÖÖ¿É°üº¬¶àÖÖÀàÐÍÊý¾ÝµÄ¹¹ÔìÀàÐÍÍ⣬»¹ÌṩÁËÒ»ÖÖ´ÓÐÎʽÉÏ¿´ºÍ½á¹¹Ìå¿°³Æ“ÂÏÉúÐֵܔµÄ¹¹ÔìÀàÐÍ——¹²ÓÃÌ壨union£©¡£
±¾½Ú´Ó¹²ÓÃÌåµÄ¸ÅÄîÈëÊÖ£¬´Ó¹²ÓÃÌåµÄ¸ÅÄî¡¢Óë½á¹¹ÌåµÄÒìͬ¡¢Ê¹Óõȷ½Ãæ½øÐÐÏêϸµÄ½éÉÜ¡£
9.2.1  ʲôÊǹ²ÓÃÌå
ÏÖʵÉú»îÖУ¬Ä³Ð©ÊÂÎïÍùÍù¿ÉÒÔÓöàÖÖ·½Ê½È¥±íÊö£¬¸÷ÖÖ·½Ê½µÄµØλÊÇƽµÈµÄ£¬¶¼ÊÇ´Ó²»Í¬µÄ²àÃæÈ¥·´Ó¦Õâ¸öÊÂÎï¡£ÀýÈ磬¹ÅÈËÓõÄ×Ö¡¢Ãû¡¢ºÅ£¬¶¼ÊǶÔÒ»¸öÈ˵ijÆν£¬µ«ÊÇ»á¸ù¾Ý²»Í¬µÄ³¡ºÏºÍÇé¿öʹÓÃÆäÖеÄÒ»ÖÖ¡£ÓÖÀýÈ磬ÓÃÊý×ÖºÍÓÃÓÅ¡¢Á¼¡¢ÖС¢²î¶¼¿ÉÒÔ±íʾ³É¼¨£¬¾ßÌåʹÓÃÉÏ¿ÉÄܸù¾Ý³É¼¨µÄÖÖÀ಻ͬ¶øÑ¡ÓÃÆäÖеÄÒ»ÖÖ·½Ê½¡£
Èç¹ûÕâЩ·½Ê½¿ÉÒÔÓÃͬһÖÖÀàÐÍÀ´±íʾ£¬ÄÇôÊý×é“ÃãÇ¿”Äܹ»ÓÃÀ´¶ÔÆä½øÐд洢£¬µ«ÀË·Ñ´æ´¢¿Õ¼ä¡£¶øÈç¹ûÆäÊý¾ÝÀàÐͲ»Í¬£¬Êý×é¾Í“ÎÞÄÜΪÁ¦”ÁË¡£½á¹¹ÌåËƺõÒ²ÄܶÔÆä½øÐбíÊö£¬µ«²¢²»ÊÇ×î¼ÑµÄ·½Ê½¡£Õë¶ÔÕâÖÖÇé¿öÏ£¬CÓïÑÔÌṩµÄ¹²ÓÃÌåÊý¾ÝÀàÐÍ¡£
¹²ÓÃÌ壬Òà³ÆÁªºÏ£¬ÊÇÓбðÓÚÇ°ÊöÈκÎÒ»ÖÖÊý¾ÝÀàÐ͵ÄÌØÊâÊý¾ÝÀàÐÍ£¬ÆäÓÃÀ´ÃèÊöÀàÐͲ»ÏàͬµÄÊý¾Ý¡£Óë½á¹¹Ì岻ͬµÄÊÇ£º¹²ÓÃÌå¶Ô³ÉÔ±´æ´¢Ê±²ÉÓø²¸Ç¼¼Êõ£¬¹²Ïí(²¿·Ö)´æ´¢¿Õ¼ä£¬³ÉÔ±±»·ÖÅäÔÚͬһ¶ ......

C/C++

9.2  ¹²ÓÃÌå
CÓïÑÔ³ýÁËÌṩ½á¹¹ÌåÕâÖÖ¿É°üº¬¶àÖÖÀàÐÍÊý¾ÝµÄ¹¹ÔìÀàÐÍÍ⣬»¹ÌṩÁËÒ»ÖÖ´ÓÐÎʽÉÏ¿´ºÍ½á¹¹Ìå¿°³Æ“ÂÏÉúÐֵܔµÄ¹¹ÔìÀàÐÍ——¹²ÓÃÌ壨union£©¡£
±¾½Ú´Ó¹²ÓÃÌåµÄ¸ÅÄîÈëÊÖ£¬´Ó¹²ÓÃÌåµÄ¸ÅÄî¡¢Óë½á¹¹ÌåµÄÒìͬ¡¢Ê¹Óõȷ½Ãæ½øÐÐÏêϸµÄ½éÉÜ¡£
9.2.1  ʲôÊǹ²ÓÃÌå
ÏÖʵÉú»îÖУ¬Ä³Ð©ÊÂÎïÍùÍù¿ÉÒÔÓöàÖÖ·½Ê½È¥±íÊö£¬¸÷ÖÖ·½Ê½µÄµØλÊÇƽµÈµÄ£¬¶¼ÊÇ´Ó²»Í¬µÄ²àÃæÈ¥·´Ó¦Õâ¸öÊÂÎï¡£ÀýÈ磬¹ÅÈËÓõÄ×Ö¡¢Ãû¡¢ºÅ£¬¶¼ÊǶÔÒ»¸öÈ˵ijÆν£¬µ«ÊÇ»á¸ù¾Ý²»Í¬µÄ³¡ºÏºÍÇé¿öʹÓÃÆäÖеÄÒ»ÖÖ¡£ÓÖÀýÈ磬ÓÃÊý×ÖºÍÓÃÓÅ¡¢Á¼¡¢ÖС¢²î¶¼¿ÉÒÔ±íʾ³É¼¨£¬¾ßÌåʹÓÃÉÏ¿ÉÄܸù¾Ý³É¼¨µÄÖÖÀ಻ͬ¶øÑ¡ÓÃÆäÖеÄÒ»ÖÖ·½Ê½¡£
Èç¹ûÕâЩ·½Ê½¿ÉÒÔÓÃͬһÖÖÀàÐÍÀ´±íʾ£¬ÄÇôÊý×é“ÃãÇ¿”Äܹ»ÓÃÀ´¶ÔÆä½øÐд洢£¬µ«ÀË·Ñ´æ´¢¿Õ¼ä¡£¶øÈç¹ûÆäÊý¾ÝÀàÐͲ»Í¬£¬Êý×é¾Í“ÎÞÄÜΪÁ¦”ÁË¡£½á¹¹ÌåËƺõÒ²ÄܶÔÆä½øÐбíÊö£¬µ«²¢²»ÊÇ×î¼ÑµÄ·½Ê½¡£Õë¶ÔÕâÖÖÇé¿öÏ£¬CÓïÑÔÌṩµÄ¹²ÓÃÌåÊý¾ÝÀàÐÍ¡£
¹²ÓÃÌ壬Òà³ÆÁªºÏ£¬ÊÇÓбðÓÚÇ°ÊöÈκÎÒ»ÖÖÊý¾ÝÀàÐ͵ÄÌØÊâÊý¾ÝÀàÐÍ£¬ÆäÓÃÀ´ÃèÊöÀàÐͲ»ÏàͬµÄÊý¾Ý¡£Óë½á¹¹Ì岻ͬµÄÊÇ£º¹²ÓÃÌå¶Ô³ÉÔ±´æ´¢Ê±²ÉÓø²¸Ç¼¼Êõ£¬¹²Ïí(²¿·Ö)´æ´¢¿Õ¼ä£¬³ÉÔ±±»·ÖÅäÔÚͬһ¶ ......

C/C++ѧϰ±Ê¼Ç[01].×ÝÏò´òÓ¡ÕûÊý

#include <stdio.h>
#include <string.h>
#include <math.h>
#define BASE 10
int intlen(long n);
int main()
{
int i, j, num, sz;
i = j = num = sz = 0;
if (!scanf("%d", &num) || num <= 0) {
printf("invalid input\n");
return 1;
}
sz = intlen(num);
for (i = sz; i > 0; i--) {
for (j = 1; j <= num; j++) {
printf("%d",(j % (int) (pow(BASE,i))) / (int) (pow(BASE,i - 1)));
}
printf("\n");
}
return 0;
}
int intlen(long n)
{
return log10(fabs(n)) + 1;
}
/* vim: set ts=4 sw=4: */

´Ó±ê×¼ÊäÈë½ÓÊÕÒ»¸ö´óÓÚ0µÄÕûÊý,ÊúÏò´òÓ¡1-Õâ¸öÊýÖ®¼äµÄÊý
Óõ½Á˶ÔÊýº¯ÊýÈ¡ÕûÊýµÄλÊý,È¡Ä£ÔËËã,Õû³ýÔËËã,Ö¸ÊýÔËËã ......

C/C++ѧϰ±Ê¼Ç[01].×ÝÏò´òÓ¡ÕûÊý

#include <stdio.h>
#include <string.h>
#include <math.h>
#define BASE 10
int intlen(long n);
int main()
{
int i, j, num, sz;
i = j = num = sz = 0;
if (!scanf("%d", &num) || num <= 0) {
printf("invalid input\n");
return 1;
}
sz = intlen(num);
for (i = sz; i > 0; i--) {
for (j = 1; j <= num; j++) {
printf("%d",(j % (int) (pow(BASE,i))) / (int) (pow(BASE,i - 1)));
}
printf("\n");
}
return 0;
}
int intlen(long n)
{
return log10(fabs(n)) + 1;
}
/* vim: set ts=4 sw=4: */

´Ó±ê×¼ÊäÈë½ÓÊÕÒ»¸ö´óÓÚ0µÄÕûÊý,ÊúÏò´òÓ¡1-Õâ¸öÊýÖ®¼äµÄÊý
Óõ½Á˶ÔÊýº¯ÊýÈ¡ÕûÊýµÄλÊý,È¡Ä£ÔËËã,Õû³ýÔËËã,Ö¸ÊýÔËËã ......

C/C++ÔËÐÐÖеÄһЩÎÊÌâ¼°Æä½â¾ö

±¾ÈËÔÚ×ö±ÏÉèµÄʱºòÓöµ½µÄһЩÎÊÌ⣬ÔÚÕâÀï×ܽáһϣ¬Ï£Íû»á¶Ô´ó¼ÒÓÐЩ°ïÖú~Óв»×ãÖ®´¦»¹ÍûÖ¸³ö£¬´ó¼Ò¹²Í¬½ø²½^_^
 Ò»¡¢»ù±¾½éÉÜ£º
1.ÔËÐл·¾³VC6.0£¨Microsoft Visual C++ 6.0£©£¨http://40.duote.org/microsoft_visualc6.zip£©
2.¿ÎÌâÏà¹ØÄÚÈÝ£ºAVSÊÓƵ±àÂë
¶þ¡¢³öÏÖµÄÎÊÌâ¼°½â¾ö·½·¨£º
1.ÎÊÌ⣺
fatal error C1083:"Cannot open include file: 'Dshow.h': No such file or directoryÖ´ÐÐ cl.exe ʱ³ö´í"
½â¾ö£º
°²×°DirectX SDK(Nov_08°æ)£¨ http://download.microsoft.com/download/5/8/2/58223f79-689d-47ae-bdd0-056116ee8d16/DXSDK_Nov08.exe£©
Platform SDK(PSDK-x86)£¨http://download.microsoft.com/download/a/5/f/a5f0d781-e201-4ab6-8c6a-9bb4efed1e1a/PSDK-x86.exe£©
ÔÚTools£­>OptionµÄÑ¡ÏdirectoriesÖÐÔö¼ÓÏàÓ¦ÏîÄ¿¡£
ÔÚInclude filesÔö¼ÓDirectX£¬DirectShowµÄInclude·¾¶£¬ÔÚLibrary filesÖÐÔö¼ÓDirectX£¬DirectShowµÄLib·¾¶¡£
------------------------------------------------------------------
2. ÎÊÌ⣺
fatal error C1083: Cannot open include file: 'dxtrans.h': No such file or directory
½â¾ö£º
°²×°DX ......

C/C++ÔËÐÐÖеÄһЩÎÊÌâ¼°Æä½â¾ö

±¾ÈËÔÚ×ö±ÏÉèµÄʱºòÓöµ½µÄһЩÎÊÌ⣬ÔÚÕâÀï×ܽáһϣ¬Ï£Íû»á¶Ô´ó¼ÒÓÐЩ°ïÖú~Óв»×ãÖ®´¦»¹ÍûÖ¸³ö£¬´ó¼Ò¹²Í¬½ø²½^_^
 Ò»¡¢»ù±¾½éÉÜ£º
1.ÔËÐл·¾³VC6.0£¨Microsoft Visual C++ 6.0£©£¨http://40.duote.org/microsoft_visualc6.zip£©
2.¿ÎÌâÏà¹ØÄÚÈÝ£ºAVSÊÓƵ±àÂë
¶þ¡¢³öÏÖµÄÎÊÌâ¼°½â¾ö·½·¨£º
1.ÎÊÌ⣺
fatal error C1083:"Cannot open include file: 'Dshow.h': No such file or directoryÖ´ÐÐ cl.exe ʱ³ö´í"
½â¾ö£º
°²×°DirectX SDK(Nov_08°æ)£¨ http://download.microsoft.com/download/5/8/2/58223f79-689d-47ae-bdd0-056116ee8d16/DXSDK_Nov08.exe£©
Platform SDK(PSDK-x86)£¨http://download.microsoft.com/download/a/5/f/a5f0d781-e201-4ab6-8c6a-9bb4efed1e1a/PSDK-x86.exe£©
ÔÚTools£­>OptionµÄÑ¡ÏdirectoriesÖÐÔö¼ÓÏàÓ¦ÏîÄ¿¡£
ÔÚInclude filesÔö¼ÓDirectX£¬DirectShowµÄInclude·¾¶£¬ÔÚLibrary filesÖÐÔö¼ÓDirectX£¬DirectShowµÄLib·¾¶¡£
------------------------------------------------------------------
2. ÎÊÌ⣺
fatal error C1083: Cannot open include file: 'dxtrans.h': No such file or directory
½â¾ö£º
°²×°DX ......

C\C++ÖÐÊý×éÔªËØϱêÔ½½ç¿ÉÄÜÒýÆðµÄÎÊÌâ

Êý×éÊÇÀàÐÍÏàͬµÄ¶ÔÏóµÄÐòÁУ¬ÆäÖеĶÔÏó³ÆΪÊý×éÔªËØ¡£Ò²¿ÉÒÔ½«Êý×éÏëÏñ³ÉÒ»Á¬´®µÄÓÃϱêÖµ±àºÅµÄÏàÁÚ´æ´¢Çø¡£
       ¿ÉÄÜÔÚijЩ±à³ÌÓïÑÔÖУ¬Ò»¸öϱê±äÁ¿ÊDz»ÔÊÐí³¬³öÊý×鶨ÒåÖÐËùÉèµÄ½çÏ޵ġ£µ«ÊÇÔÚCºÍC++ÖУ¬Êý×éÊÇûÓÐÕâÖÖ°²È«´ëÊ©µÄ¡£ÏÂÃæÏÈÀ´¿´¿´Êý×éϱêÔ½½çµÄ¼¸ÖÖÒì³£½á¹û¡£
       Àý1£¬·ÃÎÊûÓзÖÅä¸øÊý×éµÄÄÚ´æ¿Õ¼ä¡£
       int main ()
       {
             const int SIZE = 4;
             int a[SIZE] = {12,40,45,10};
             for (int i = 0; i<5 : i++)
                 cout << "\t a[" << i << "] = " << a[i] << endl;
       }
  &nbs ......

C\C++ÖÐÊý×éÔªËØϱêÔ½½ç¿ÉÄÜÒýÆðµÄÎÊÌâ

Êý×éÊÇÀàÐÍÏàͬµÄ¶ÔÏóµÄÐòÁУ¬ÆäÖеĶÔÏó³ÆΪÊý×éÔªËØ¡£Ò²¿ÉÒÔ½«Êý×éÏëÏñ³ÉÒ»Á¬´®µÄÓÃϱêÖµ±àºÅµÄÏàÁÚ´æ´¢Çø¡£
       ¿ÉÄÜÔÚijЩ±à³ÌÓïÑÔÖУ¬Ò»¸öϱê±äÁ¿ÊDz»ÔÊÐí³¬³öÊý×鶨ÒåÖÐËùÉèµÄ½çÏ޵ġ£µ«ÊÇÔÚCºÍC++ÖУ¬Êý×éÊÇûÓÐÕâÖÖ°²È«´ëÊ©µÄ¡£ÏÂÃæÏÈÀ´¿´¿´Êý×éϱêÔ½½çµÄ¼¸ÖÖÒì³£½á¹û¡£
       Àý1£¬·ÃÎÊûÓзÖÅä¸øÊý×éµÄÄÚ´æ¿Õ¼ä¡£
       int main ()
       {
             const int SIZE = 4;
             int a[SIZE] = {12,40,45,10};
             for (int i = 0; i<5 : i++)
                 cout << "\t a[" << i << "] = " << a[i] << endl;
       }
  &nbs ......

²éÕÒ×Ö·û´®ÖÐ×Ö·û²»Öظ´µÄ×î´ó×Ó´®(C/C++)

 //ÊäÈë²ÎÊý£º*str ËÑË÷×Ö·û´®
// subStrLen ÓÃÓÚ·µ»ØÕÒµ½µÄ×î´ó×Ó×Ö·û´®³¤¶È
//·µ»Ø£ºÕÒµ½µÄ×î´ó×Ó×Ö·û´®Ö¸Õë
char * findMaxSubStr(char *str, int &subStrLen){
char *subStr;
char *p = str;
int index[256] ;
for (int ix = 0; ix < sizeof(index)/sizeof(index[0]); ix++)
{
index[ix] = -1;
}
int subStrPos = 0; // ×Ó×Ö·û´®ÔÚ×Ö·û´®strÖеÄÆ«ÒÆ
int charPos = 0; // µ±Ç°×Ö·ûÔÚ×Ö·û´®strÖеÄÆ«ÒÆ
int currLen = 0; //µ±Ç°×Ó×Ö·û´®³¤¶È
int maxLen = 0; //ÒѾ­ÕÒµ½µÄ×î´ó×Ó×Ö·û´®³¤¶È

char ch;
while (ch = *p)
{
if (index[ch] < subStrPos){ //×Ö·ûÊ״γöÏÖ »òÕß ×Ö·ûÔÚ×Ó×Ö·û´®¿ªÊ¼µÄλÖúóÊ״γöÏÖ
index[ch] = charPos;
currLen++;
}else {
currLen = charPos - index[ch];
subStrPos = ++index[ch];
index[ch] = charPos;
}
if (currLen > maxLen)
{
subStr = str + subStrPos;
maxLen = currLen;
}
p++;
charPos++;
}
subStrLen = maxLen;
return subStr;
} ......

²éÕÒ×Ö·û´®ÖÐ×Ö·û²»Öظ´µÄ×î´ó×Ó´®(C/C++)

 //ÊäÈë²ÎÊý£º*str ËÑË÷×Ö·û´®
// subStrLen ÓÃÓÚ·µ»ØÕÒµ½µÄ×î´ó×Ó×Ö·û´®³¤¶È
//·µ»Ø£ºÕÒµ½µÄ×î´ó×Ó×Ö·û´®Ö¸Õë
char * findMaxSubStr(char *str, int &subStrLen){
char *subStr;
char *p = str;
int index[256] ;
for (int ix = 0; ix < sizeof(index)/sizeof(index[0]); ix++)
{
index[ix] = -1;
}
int subStrPos = 0; // ×Ó×Ö·û´®ÔÚ×Ö·û´®strÖеÄÆ«ÒÆ
int charPos = 0; // µ±Ç°×Ö·ûÔÚ×Ö·û´®strÖеÄÆ«ÒÆ
int currLen = 0; //µ±Ç°×Ó×Ö·û´®³¤¶È
int maxLen = 0; //ÒѾ­ÕÒµ½µÄ×î´ó×Ó×Ö·û´®³¤¶È

char ch;
while (ch = *p)
{
if (index[ch] < subStrPos){ //×Ö·ûÊ״γöÏÖ »òÕß ×Ö·ûÔÚ×Ó×Ö·û´®¿ªÊ¼µÄλÖúóÊ״γöÏÖ
index[ch] = charPos;
currLen++;
}else {
currLen = charPos - index[ch];
subStrPos = ++index[ch];
index[ch] = charPos;
}
if (currLen > maxLen)
{
subStr = str + subStrPos;
maxLen = currLen;
}
p++;
charPos++;
}
subStrLen = maxLen;
return subStr;
} ......

½ÌÄãÀí½â¸´ÔÓµÄC/C++ÉùÃ÷[ת]

Ô­ÎÄ£º
http://www.codeproject.com/cpp/complex_declarations.asp
×÷ÕߣºVikram A Punathambekar
½éÉÜ
Ôø¾­Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) ) [10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Â𣿱¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷£ºÎÒÃǽ«´ÓÿÌ춼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊηûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ룬×îºó½éÉÜÒ»¸öÄܹ»ÈÃÄã׼ȷµØÀí½âÈκÎC/C++ÉùÃ÷µÄ“ÓÒ×ó·¨Ôò”¡£ÐèҪǿµ÷һϵÄÊÇ£¬¸´ÔÓµÄC/C++ÉùÃ÷²¢²»ÊǺõıà³Ì·ç¸ñ£»ÎÒÕâÀï½ö½öÊǽÌÄãÈçºÎÈ¥Àí½âÕâЩÉùÃ÷¡£×¢Ò⣺ΪÁ˱£Ö¤Äܹ»ÔÚͬһÐÐÉÏÏÔʾ´úÂëºÍÏà¹Ø×¢ÊÍ£¬±¾ÎÄ×îºÃÔÚÖÁÉÙ1024x768·Ö±æÂʵÄÏÔʾÆ÷ÉÏÔĶÁ¡£
»ù´¡
ÈÃÎÒÃÇ´ÓÒ»¸ö·Ç³£¼òµ¥µÄÀý×Ó¿ªÊ¼£¬ÈçÏ£º
int n;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare n as an int”£¨nÊÇÒ»¸öintÐ͵ıäÁ¿£©¡£
½ÓÏÂÈ¥À´¿´Ò»ÏÂÖ¸Õë±äÁ¿£¬ÈçÏ£º
int *p;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare p as an int *”£¨pÊÇÒ»¸öint *Ð͵ıäÁ¿£©£¬»òÕß˵pÊÇÒ»¸öÖ¸ÏòÒ»¸öintÐͱäÁ¿µÄÖ¸Õë¡£ÎÒÏëÔÚÕâÀïÕ¹¿ªÌÖÂÛһϣºÎÒ¾õµÃÔÚÉùÃ÷Ò»¸öÖ¸Õ루»òÒýÓã©ÀàÐ͵ıäÁ¿Ê±£¬×îºÃ½«*£¨»ò&£©Ð´ÔÚ½ô¿¿±äÁ¿Ö®Ç°£¬¶ø²»Êǽô¸ú»ù±¾ÀàÐÍÖ®ºó¡ ......

½ÌÄãÀí½â¸´ÔÓµÄC/C++ÉùÃ÷[ת]

Ô­ÎÄ£º
http://www.codeproject.com/cpp/complex_declarations.asp
×÷ÕߣºVikram A Punathambekar
½éÉÜ
Ôø¾­Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) ) [10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Â𣿱¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷£ºÎÒÃǽ«´ÓÿÌ춼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊηûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ룬×îºó½éÉÜÒ»¸öÄܹ»ÈÃÄã׼ȷµØÀí½âÈκÎC/C++ÉùÃ÷µÄ“ÓÒ×ó·¨Ôò”¡£ÐèҪǿµ÷һϵÄÊÇ£¬¸´ÔÓµÄC/C++ÉùÃ÷²¢²»ÊǺõıà³Ì·ç¸ñ£»ÎÒÕâÀï½ö½öÊǽÌÄãÈçºÎÈ¥Àí½âÕâЩÉùÃ÷¡£×¢Ò⣺ΪÁ˱£Ö¤Äܹ»ÔÚͬһÐÐÉÏÏÔʾ´úÂëºÍÏà¹Ø×¢ÊÍ£¬±¾ÎÄ×îºÃÔÚÖÁÉÙ1024x768·Ö±æÂʵÄÏÔʾÆ÷ÉÏÔĶÁ¡£
»ù´¡
ÈÃÎÒÃÇ´ÓÒ»¸ö·Ç³£¼òµ¥µÄÀý×Ó¿ªÊ¼£¬ÈçÏ£º
int n;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare n as an int”£¨nÊÇÒ»¸öintÐ͵ıäÁ¿£©¡£
½ÓÏÂÈ¥À´¿´Ò»ÏÂÖ¸Õë±äÁ¿£¬ÈçÏ£º
int *p;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare p as an int *”£¨pÊÇÒ»¸öint *Ð͵ıäÁ¿£©£¬»òÕß˵pÊÇÒ»¸öÖ¸ÏòÒ»¸öintÐͱäÁ¿µÄÖ¸Õë¡£ÎÒÏëÔÚÕâÀïÕ¹¿ªÌÖÂÛһϣºÎÒ¾õµÃÔÚÉùÃ÷Ò»¸öÖ¸Õ루»òÒýÓã©ÀàÐ͵ıäÁ¿Ê±£¬×îºÃ½«*£¨»ò&£©Ð´ÔÚ½ô¿¿±äÁ¿Ö®Ç°£¬¶ø²»Êǽô¸ú»ù±¾ÀàÐÍÖ®ºó¡ ......
×ܼǼÊý:969; ×ÜÒ³Êý:162; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [16] [17] [18] [19] 20 [21] [22] [23] [24] [25]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ