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

Cö¾ÙÀàÐ͵ÄʹÓ÷½·¨

1.  ö¾ÙµÄ¶¨Òåö¾ÙÀàÐͶ¨ÒåµÄÒ»°ãÐÎʽΪ£º
    enum ö¾ÙÃû{ ö¾ÙÖµ±í };
ÔÚö¾ÙÖµ±íÖÐÓ¦ÂÞÁгöËùÓпÉÓÃÖµ¡£ÕâЩֵҲ³ÆÎªÃ¶¾ÙÔªËØ¡£
ÀýÈ磺
   
¸Ãö¾ÙÃûΪweekday£¬Ã¶¾ÙÖµ¹²ÓÐ7¸ö£¬¼´Ò»ÖÜÖÐµÄÆßÌì¡£·²±»ËµÃ÷ΪweekdayÀàÐͱäÁ¿µÄȡֵֻÄÜÊÇÆßÌìÖеÄijһÌì¡£
2.  ö¾Ù±äÁ¿µÄ˵Ã÷
Èçͬ½á¹¹ºÍÁªºÏÒ»Ñù£¬Ã¶¾Ù±äÁ¿Ò²¿ÉÓò»Í¬µÄ·½Ê½ËµÃ÷£¬¼´Ïȶ¨Òåºó˵Ã÷£¬Í¬Ê±¶¨Òå˵Ã÷»òÖ±½Ó˵Ã÷¡£
ÉèÓбäÁ¿a,b,c±»ËµÃ÷ΪÉÏÊöµÄweekday£¬¿É²ÉÓÃÏÂÊöÈÎÒ»ÖÖ·½Ê½£º
enum weekday{ sun,mou,tue,wed,thu,fri,sat };
enum weekday a,b,c;
»òÕßΪ£º
enum weekday{ sun,mou,tue,wed,thu,fri,sat }a,b,c;
»òÕßΪ£º
enum { sun,mou,tue,wed,thu,fri,sat }a,b,c;
 
ö¾ÙÀàÐÍÔÚʹÓÃÖÐÓÐÒÔϹ涨£º
1.  ö¾ÙÖµÊdz£Á¿£¬²»ÊDZäÁ¿¡£²»ÄÜÔÚ³ÌÐòÖÐÓø³ÖµÓï¾äÔÙ¶ÔËü¸³Öµ¡£
  ÀýÈç¶Ôö¾ÙweekdayµÄÔªËØÔÙ×÷ÒÔϸ³Öµ£º
    sun=5;
mon=2;
sun=mon;
¶¼ÊÇ´íÎóµÄ¡£
2.  ö¾ÙÔªËØ±¾ÉíÓÉϵͳ¶¨ÒåÁËÒ»¸ö±íʾÐòºÅµÄÊýÖµ£¬´Ó0¿ªÊ¼Ë³Ðò¶¨ÒåΪ0£¬1£¬2…¡£ÈçÔÚweekdayÖУ¬sunֵΪ0£¬monֵΪ1£¬…,satֵΪ6¡£
¡¾Àý11.10¡¿
main(){
    enum weekday
    { sun,mon,tue,wed,thu,fri,sat } a,b,c;
    a=sun;
    b=mon;
    c=tue;
    printf("%d,%d,%d",a,b,c);
}
˵Ã÷£º
Ö»ÄܰÑö¾ÙÖµ¸³Óèö¾Ù±äÁ¿£¬²»ÄܰÑÔªËØµÄÊýÖµÖ±½Ó¸³Óèö¾Ù±äÁ¿¡£È磺
    a=sum;
b=mon;
ÊÇÕýÈ·µÄ¡£¶ø£º
    a=0;
b=1;
ÊÇ´íÎóµÄ¡£ÈçÒ»¶¨Òª°ÑÊýÖµ¸³Óèö¾Ù±äÁ¿£¬Ôò±ØÐëÓÃÇ¿ÖÆÀàÐÍת»»¡£
È磺
    a=(enum weekday)2;
ÆäÒâÒåÊǽ«Ë³ÐòºÅΪ2µÄö¾ÙÔªËØ¸³Óèö¾Ù±äÁ¿a£¬Ï൱ÓÚ£º
    a=tue;
»¹Ó¦¸Ã˵Ã÷µÄÊÇö¾ÙÔªËØ²»ÊÇ×Ö·û³£Á¿Ò²²»ÊÇ×Ö·û´®³£Á¿£¬Ê¹ÓÃʱ²»Òª¼Óµ¥¡¢Ë«ÒýºÅ¡£
¡¾Àý11.11¡¿
main(){
    enum body
    { a,b,c,d } month[31],j;
    int i;
    j=a;
    for(i=1;i<=30;i++){
      month[i]=j;
      j++;//VC²»Ö§³Ö×ÔÔöÔËËã
      if (j>d) j=a;


Ïà¹ØÎĵµ£º

C/C++ÖеÄstatic

C++ÖеÄStaticÓÐÁ½¸ö×÷Óá£
1¡¢ ¾²Ì¬¾Ö²¿±äÁ¿ 
   ¾²Ì¬¾Ö²¿±äÁ¿ÔÚº¯ÊýÄÚ¶¨Òå ËüµÄÉú´æÆÚΪÕû¸öÔ´³ÌÐò£¬µ«ÊÇÆä×÷ÓÃÓòÔڸú¯ÊýÄÚ£¬Ö»ÄÜÔÚ¶¨Òå¸Ã±äÁ¿µÄº¯ÊýÄÚʹÓøñäÁ¿¡£ ÔÊÐí¶Ô¹¹ÔìÀྲ̬¾Ö²¿Á¿¸³³õÖµ£¬Èôδ¸³ÒÔ³õÖµ£¬ÔòÓÉϵͳ×Ô¶¯¸³ÒÔ0Öµ¡£ 
void fun1()
{
static int i = 0;
......

090928ÈÕcÓïÑÔѧϰÈռǣ¨ÎļþI/O)

#include<stdio.h>
#include<stdlib.h>
#define MAX 41
static int i=0;
int main(void)
{
FILE *fp;
char words[MAX];
if((fp=fopen("words","a+"))==NULL)
{
fprintf(stdout,"Can't open \" word\" file\n");
exit(1);
}
puts("Enter words to add to the file,press the enter.");
......

C/C++ Ò×´í

char c[] = "hello world"   ·ÖÅä¾Ö²¿Êý×é
char* c = "hello world"   ·ÖÅäÈ«¾ÖÊý×é  È«¾ÖÇøÓòµÄÖµÊDz»ÄܽøÐÐÐ޸ĵÄ
1 ³£Á¿Ö¸Õ룡Èç int b, c; int * const a = &b;
±íʾaÊÇÒ»¸ö³£Á¿Ö¸ÕëËüÖ¸Ïò±äÁ¿bµÄÄÚ´æ¡£µ«ÊÇÒòΪÊdz£Á¿Ö¸ÕëËùÒÔ²»ÄÜÔÙÓÃaÖ¸ÏòÆäËû±äÁ¿£¬Èç a = &c; ´íÎ󣡿ÉÒÔÐÞ¸ÄÖ ......

CÓïÑÔʹÓÃÕýÔò±í´ïʽ£¨2£©

GNU/LinuxÓÐÁ½Ì׿â¿ÉÓÃÓÚÕýÔò±í´ïʽ±à³Ì£ºPOSIX¿âºÍPCRE¿â¡£Ç°Õß²»ÐèÒªµ¥¶À°²×°£¬Ò»°ãÐèÇó»¹ÊÇÄÜÂú×ãµÄ£¬ËÙ¶ÈÉÔÂýЩ¡£ºóÕßÊǾøºÊ¢ÃûµÄPerlÕýÔò±í´ïʽ¿â£¬¹¦ÄÜÇ¿´ó£¬Æ¥ÅäËٶȿ죬²»¹ý¿ÉÄÜÐèÒªµ¥¶À°²×°¡£
ÎÒÃÇÏÈÓÃÒ»¸öÀý×ÓÀ´½éÉÜÈçºÎʹÓÃPOSIX¿â¡£
££i nclude <stdio.h>
££i nclude <sys/ty ......

PythonµÄC/C++À©Õ¹

  Python
µÄ
C/C++
À©Õ¹
                         
By phidoit@gmail.com
 
¿ÉÀ©Õ¹ÐÔÊÇ
Python
µÄÒ»´óÌØÉ«£¬Ò»·½Ã棬ÓÉÓÚ
Python
ÊǽâÊÍÖ´Ðеģ¬Õâµ¼ÖÂÔËÐÐËÙ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ