cºÍc++ÖеÄconstµÄÇø±ð
ÏÈ¿´Ò»¸ö³ÌÐò
#include <stdio.h>
int main()
{
const int a = 5;
int b[a];
return 0;
}
ÔÚvc6.0ÖÐÃüÃûΪ.cÎļþ£¬±àÒë»á³ö´í£¬ÊÇint b[a]ÕâÒ»ÐУºexpected constant expression
ÃüÃûΪ.cppÎļþ£¬Ã»ÎÊÌâ¡£
ÔÚcodeblocks(Ò»¸öÃâ·Ñ¿ªÔ´µÄ±àÒëÆ÷)ÖбàÒ붼ûÎÊÌâ
»¹ÓÐÒ»¸ö³ÌÐò
#include <stdio.h>
int main()
{
const int a = 5;
int b = 4;
switch (b)
{
case 3:
case a:
case 4:
printf("asdf");
break;
}
return 0;
}
ÔÚvc6.0ÖÐÃüÃûΪ.cÎļþ£¬±àÒë»á³ö´í£¬ÊÇcase a:ÕâÒ»ÐУºcase expression not constant
ÃüÃûΪ.cppÎļþ£¬Ã»ÎÊÌâ¡£
ÔÚcodeblocksÖÐн¨c¹¤³ÌÎļþ±àÒë»á³ö´í£¬Ð½¨c++¹¤³ÌÎļþ²»»á³ö´í¡£
´ÓÉÏÃæÁ½¸öÀý×ÓÊDz»ÊÇ˵ÔÚcÖÐÓÃconst¶¨ÒåµÄaÊÇÒ»¸öÖ»¶ÁµÄ±äÁ¿£¬¶øÔÚc++ÖÐÓÃconst¶¨ÒåµÄa±»µ±³ÉÒ»¸ö³£Á¿ÁË£¿
Chiyer¡¿:
constÊÇÒ»¸öCÓïÑԵĹؼü×Ö£¬ËüÏÞ¶¨Ò»¸ö±äÁ¿²»ÔÊÐí±»¸Ä±ä¡£Ê¹ÓÃconstÔÚÒ»¶¨³Ì¶ÈÉÏ¿ÉÒÔÌá¸ß³ÌÐòµÄ½¡×³ÐÔ£¬ÁíÍ⣬ÔÚ¹Û¿´±ðÈË´úÂëµÄʱºò£¬ÇåÎúÀí½âconstËùÆðµÄ×÷Ó㬶ÔÀí½â¶Ô·½µÄ³ÌÐòÒ²ÓÐһЩ°ïÖú¡£
ËäÈ»ÕâÌýÆðÀ´ºÜ¼òµ¥£¬µ«Êµ¼ÊÉÏ£¬constµÄʹÓÃÒ²ÊÇcÓïÑÔÖÐÒ»¸ö±È½Ï΢ÃîµÄµØ·½£¬Î¢ÃîÔںδ¦ÄØ£¿Çë¿´ÏÂÃ漸¸öÎÊÌâ¡£
¡¡¡¡ÎÊÌ⣺const±äÁ¿ & ³£Á¿
¡¡¡¡ÎªÊ²Ã´
Ïà¹ØÎÊ´ð£º
#include <stdio.h>
#include <graphics.h>
void main()
{
int x0,y0,x1,y1,driver,mode,i;
driver=VGA;
mode=VGAHI;
initgraph(&driver,&mode,&qu ......
ÎÊһϣº
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
×î½üͻȻÏë×Ô¼ºÀ´ÊµÏÖÒ»¸öÎå×ÓÆå³ÌÐò,µ«²»ÖªµÀÔõô¿ªÊ¼,×Ô¼ºÒ²Ã»Ñ§»Í¼Ðκ¯Êý,ÄÜÔÚ¿ØÖÆ̨ÏÂÖ±½ÓдÂð>>>?????
¿ØÖÆ̨£¿±ÈͼÐνçÃæ¸üÂé·³¡£
http://search.download.csdn.net/search/%E4%BA%94%E5%AD%90% ......
ÎÊÌâ:¹¤µØÉÏÐèÒª³¤¶ÈΪA1µÄ¸Ö½îX¸ù,³¤¶ÈΪA2µÄ¸Ö½îY¸ù,³¤¶ÈΪA3µÄ¸Ö½îZ¸ù......ÒÔ´ÎÀàÍÆ.
ÆäÖÐA1,A2,A3,...³¤¶ÈÈÎÒâÖ¸¶¨,X,Y,Z,...ÊýÁ¿Ò²ÈÎÒâÖ¸¶¨.
µ«²Ö¿âÖеĸֽîΪ±ê×¼³¤¶È,Ö»ÓÐ9Ã׺Í15Ã×Á½ÖÖ³¤¶È,ÊýÁ¿² ......
±³¾°£º
££££££££
Í·Îļþdb_method.h¾¹ýÃÀ»¯ºó´æÔÚÏÂÃ漸Öֽṹ¶¨ÒåÀàÐÍ
typedef struct
{
BYTE id;
BYTE idAsync;
DM_T dmInfo;
CHAR tbName[MAX_TBNAME_LEN];
} REC ......