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

CµÄenum struct ÒÔ¼° JavaµÄenum

 ÔÚcÖÐenumµÄʹÓúÍstructºÜÏñ
enum name{
a,b,c
};

 
struct name{
int a;
int b;
char c;
};

 
or
 
typedef struct{
int a;
int b;
char c;
}Name;

ʹÓõÄʱºò¶¼ÒªÏÈÉùÃ÷±äÁ¿
 
enum name n1,n2,n3;
n1=a;
n2=b;
n3=enum name(3-1);
struct name sn1,sn2;
sn1=(struct name *)malloc(parameter*sizeof(struct name))//ʹÓÃmallocµÄʱºòҪǿÖÆת»»£»

ÔÚjavaÖÐenumµÄʹÓãº
ºÍÀàµÄ¶¨Òå·Ç³£µÄÏàÏñ£¬»òÕßÓгÆΪÊǾ²Ì¬Àࣺ
public enum MyColor{red,yellow,black};
ÔÚʹÓõÄʱºòÒªÏÈnew¶ÔÏó£»
MyColor mc=MyColor.red;//new¶ÔÏó²¢ÇÒ³õʼ»¯£»È»ºó¾Í¿ÉÒÔʹÓÃÕâ¸ö¶ÔÏó£»
public class test{
public enum MyColor{
red;
black;
}
public static void main(String [] args){
MyColor mc= MyColor.red;
switch (mc){
case red:System.out.println("red");break;
case black:System.out.println("black");break;
default:System.out.println("Error");
}
}
}


Ïà¹ØÎĵµ£º

javaÖÐÄÚ²¿ÀàµÄʹÓÃ

ÄÚ²¿ÀàµÄʹÓõÄÓÅȱµã£º
Óŵ㣺¼õÉÙÁËÔÚÀàÎļþ±àÒëºóµÄ²úÉúµÄ×Ö½ÚÂëÎļþµÄ´óС
ȱµã£ºÊ¹³ÌÐò½á¹¹²»ÇåÎú
ʹÓÃÄÚ²¿ÀàµÄ×¢ÒâÊÂÏ
ÄÚ²¿ÀàµÄʹÓÃÒ»°ã¶¼ÓëËùÔÚµÄÍⲿÀàÓÐÒ»¶¨µÄ¹ØÁª£¬ËüÊÇÔÚÒ»¸öÀàµÄÄÚ²¿Ç¶Ì׶¨ÒåµÄÀ࣬Ëü¿ÉÒÔÊÇÆäËüÀàµÄ³ÉÔ±£¬Ò²¿ÉÒÔÔÚÒ»¸öÓï¾ä¿éµÄÄÚ²¿¶¨Ò壬»¹¿ÉÒÔÔÚ±í´ïʽÄÚ²¿ÄäÃû¶¨Òå(ÄäÃûÄÚ²¿Àà)¡£
ÄÚ²¿ ......

JavaÖеÄÉÖÆÓëdz¸´ÖÆ

1£®Ç³¸´ÖÆÓëÉÖƸÅÄî
¢Ådz¸´ÖÆ£¨Ç³¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔ­À´µÄ¶ÔÏóÏàͬµÄÖµ£¬¶øËùÓеĶÔÆäËû¶ÔÏóµÄÒýÓÃÈÔȻָÏòÔ­À´µÄ¶ÔÏó¡£»»ÑÔÖ®£¬Ç³¸´Öƽö½ö¸´ÖÆËù¿¼ÂǵĶÔÏ󣬶ø²»¸´ÖÆËüËùÒýÓõĶÔÏó¡£
 
¢ÆÉÖÆ£¨Éî¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔ­À´µÄ¶ÔÏóÏàͬµÄÖµ£¬³ýÈ¥ÄÇЩÒýÓÃÆäËû¶ÔÏóµÄ±äÁ¿¡ ......

C ÖÐscanf ( ) º¯ÊýÓ÷¨ ÐĵÃ

ÎÒ¾õµÃ,ÔÚÊäÈëÊä³öº¯ÊýÖÐ,scanf()º¯Êý,Ó¦¸ÃÊÇ×îÂé·³µÄ,ÓÐʱËü¸øÎÒÃǵĽá¹ûºÜ¿ÉЦ,µ«ÊÇÒ»¶¨ÊÇÒ»Ô­ÒòµÄ....
Ê×ÏÈÉùÃ÷Ò»ÏÂ,ÕâƪÈÕÖ¾²»ÊǽéÉÜscanf()Öи÷ÖÖ¸ñʽ·ûÓ÷¨µÄÎÄÕÂ(ûÓÐÕâ¸ö±ØÒª,µ«ÊÇ´ó¼ÒÒ»¶¨Òª»áÓÃ).
ÎÒ³¢ÊÔÁ˺ܶàÖÖÊäÈë,°üÀ¨Ò»Ð©´íÎóµÄÁ·Ï°,Ôø¾­¶Ôscanf()ÓÉÃÔãתÏòÇåÐÑ,ÓÖÓÉÇåÐÑÔÙ´ÎתÏòÃÔã......²»ÖªµÀºÎʱÊǸö ......

Cר¼Ò±à³Ì¾«±àÖ®Ò»

Cר¼Ò±à³Ì  ¾«±àÖ®Ò»     µÚÒ»ÕÂ~µÚÈýÕÂ
CµÄ¸´ÔÓÖ®´¦ ÔÚÓÚËüµÄÖ¸Õë ,µ«ÊDZÈÆäÖ¸Õë¸üΪ¸´ÔÓµÄÊÇËüµÄÉùÃ÷ !!!
ÄãÄÜ¿´¶®ËüÃǵÄÒâ˼ Âð?
apple=sizeof(int)*p  ;   apple=sizeof * p;
j= (char (*)[20])malloc(20);
int   const * grape; Óë   int * const gr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ