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

ÎÒµÄCʵ¼ù(2)£ºÁªºÏµÄÃîÓÃ

    ÔÚCÓïÑÔÖУ¬ÁªºÏÀàÐÍÊÇÒ»ÖֱȽÏÌØÊâµÄÀàÐÍ£¬Æä¶à¸ö³ÉÔ±¹²ÏíÒ»¸ö´æ´¢Çø£¨Îª×î´ó³ÉÔ±µÄ³¤¶È£©£¬Ò»´ÎÖ»ÄÜ°üº¬Ò»¸ö³ÉÔ±Öµ£¬»á½øÐÐÄÚ´æ¶ÔÆë¡£¶ÔÁªºÏÀàÐͽøÐÐsizeofÔËËã»á°üÀ¨ËùÓгÉÔ±ËùÐèÒªµÄ´æ´¢¿Õ¼äÁ¿£¬»¹°üÀ¨³ÉÔ±¼äºÍ³ÉÔ±ºóÃæµÄÌî³ä¿Õ¼ä¡£ÁªºÏÀàËÆÓÚÆäËûÓïÑÔÖеē±äÌå¼Ç¼”£¬Èç¹ûÁªºÏµÄ³¤¶ÈºÜ´ó»òÕßÓдóÁ¿µÄÁªºÏ£¬Ôò¿ÉÒÔ´ó´ó½ÚÊ¡´æ´¢¿Õ¼ä¡£
    1¡¢ÁªºÏÖ»ÄÜÒ»´Î¸³ÖµÒ»¸ö³ÉÔ±£¬²¢Ê¹ÓÃËü£¬µ«CÓïÑÔûÓÐÌṩ²éѯÁªºÏÉÏÒ»´Î¸³ÖµËùÓóÉÔ±µÄ·½·¨¡£ÎÒÃÇ¿ÉÒÔ¶¨ÒåÒ»¸öenum£¬ÆäÖи÷¸öö¾Ù³£Á¿´ú±íunion¸÷¸ö³ÉÔ±µÄ±êÖ¾¡£È»ºó°ÑunionºÍÕâ¸öenum·â×°ÔÚÒ»¸östructÖУ¬µ±¶ÔunionµÄij¸ö³ÉÔ±¸³ÖµÊ±£¬¾ÍÉèÖÃÏàÓ¦µÄ±êÖ¾£¬ÕâÑù¾Í¿ÉÒÔ¸ú×ÙÁªºÏµÄ³ÉÔ±¸³Öµ¡£
/* widget.c£ºÓÃö¾Ù³£Á¿À´¸ú×ÙÁªºÏÀàÐ͵ijÉÔ±¸³Öµ */
#include <stdio.h>
#include <string.h>
enum widget_tag{ /* ÁªºÏµÄ¸÷¸ö³ÉÔ±µÄ±êÖ¾ */
count_widget,
value_widget,
name_widget
};
struct WIDGET{ /* °ÑunionºÍenum·â×°ÔÚÒ»¸östructÖÐ */
enum widget_tag tag;
union{
long count;
double value;
char name[10];
} data;
} x;
typedef struct WIDGET widget;
/* µ÷Óñ¾º¯Êý¾Í¿ÉÒÔ²»±Ø¿¼ÂÇÁªºÏµÄÉÏÒ»´Î¸³ÖµËùÓóÉÔ± */
void print_widget(widget w){
switch(w.tag){
case count_widget:
printf("Count: %ld\n",w.data.count);
break;
case value_widget:
printf("Value: %.15f\n",w.data.value);
break;
case name_widget:
printf("Name: \"%s\"\n",w.data.name);
break;
}
}
int main(){
x.tag=count_widget; /* Òª¸ø³ÉÔ±count¸³Öµ£¬ÉèÖÃÆä±êÖ¾ */
x.data.count=10000;
print_widget(x); /* »á×Ô¶¯´òÓ¡¸Ã³ÉÔ±µÄÖµ */

x.tag=value_widget;
x.data.value=3.14159265358979323846;
print_widget(x);

x.tag=name_widget;
strncpy(x.data.name,"Millard",10);
print_widget(x);
return 0;
}

    2¡¢Èç¹ûÒýÓÃÁªºÏµÄijһ¸ö³ÉÔ±£¬µ«ÁªºÏÉÏÒ»´Î¸³ÖµµÄ²»ÊǸóÉÔ±£¬ÔòÊÇÒÔ²»¿ÉÒÆÖ²µÄ·½Ê½Ê¹ÓÃÁªºÏ¡£ÎÒÃÇ¿ÉÒÔÀûÓÃÕâ¸ö·½·¨À´Á˽â¼ÆËã»úÄÚ²¿µÄһЩµ×²ãÊý¾Ý±íʾ·½·¨¡£ÀýÈçÒª·¢ÏÖ¸¡µãÊýÊÇÈçºÎ±íʾµÄ£º
#include <stdio.h>
/* ÓÃÁªºÏÀàÐÍÀ´»ñÈ¡¸¡µãÊýµÄµ×²ã±íʾ */
void prin


Ïà¹ØÎĵµ£º

C rule

Àý) Σ険¤Ê¥³ー¥Ç¥£¥ó¥°
1                char cStr[256];
2                ZeroMemory(cStr, sizeof(cStr));
3      &nb ......

oracleÖÐpro*cµÄѧϰ


oracleÖÐpro*cµÄѧϰ
¡¡Ò» Pro*C ³ÌÐò¸ÅÊö£º
1£®Ê²Ã´ÊÇPro*C³ÌÐò
ÔÚORACLEÊý¾Ý¿â¹ÜÀíºÍϵͳÖУ¬ ÓÐÈýÖÖ·ÃÎÊÊý¾Ý¿âµÄ·½·¨£»
£¨1£© ÓÃSQL*Plus£¬ ËüÓÐSQLÃüÁîÒÔ½»»¥µÄÓ¦ÓóÌÐò·ÃÎÊÊý¾Ý¿â£»
£¨2£© ÓõÚËÄ´úÓïÑÔÓ¦Óÿª·¢¹¤¾ß¿ª·¢µÄÓ¦ÓóÌÐò·ÃÎÊÊý¾Ý¿â£¬ÕâЩ¹¤¾ßÓÐSQL*froms£¬QL*Reportwriter,SQL*MenuµÈ£»
£¨3£© ÀûÓÃÔÚ ......

20100531 ¡¶CÏÝÚåÓëȱÏÝ¡·µÚÈýÕ¶ÁÊé±Ê¼Ç

  ½ñÌìÊÇ5ÔµÄ×îºóÒ»ÌìÁË£¬2010ÄêµÄ5Ô£¬µ¹Ã¹µÄÒ»¸öÔÂÖÕÓÚÒª¹ýÈ¥ÁË¡£½ñÌì³é¿ÕÎÒÓÖ¶ÁÍêÁ˵ÚÈýÕ£¬Ë³±ã×öϱʼǡ£
  ÕâÒ»ÕµÄÌâÄ¿½Ð×ö---ÓïÒå“ÏÝÚå”
  ³ÌÐòÒ²ÓпÉÄܱíÃæ¿´ÉÏÈ¥ÊÇÒ»¸öÒâ˼£¬Êµ¼ÊÉϵÄÒâ˼ȴÏàÈ¥ÉõÔ¶¡£
  ¶ÔÓÚÊý×飺
  CÓïÑÔÖÐÖ»ÓÐһάÊý×飬 ......

CÖÐexternÐÞÊηûµÄÓ÷¨

ÔÚCÓïÑÔÖУ¬ÐÞÊηûexternÓÃÔÚ±äÁ¿»òÕߺ¯ÊýµÄÉùÃ÷Ç°£¬ÓÃÀ´ËµÃ÷“´Ë±äÁ¿/º¯ÊýÊÇÔڱ𴦶¨ÒåµÄ£¬ÒªÔÚ´Ë´¦ÒýÓÔ¡£
Ò».externÐÞÊαäÁ¿µÄÉùÃ÷
¾ÙÀýÀ´Ëµ£¬Èç¹ûÎļþa.cÐèÒªÒýÓÃb.cÖбäÁ¿int v£¬¾Í¿ÉÒÔÔÚa.cÖÐÉùÃ÷extern int v£¬È»ºó¾Í¿ÉÒÔÒýÓñäÁ¿v¡£ÕâÀïÐèҪעÒâµÄÊÇ£¬±»ÒýÓõıäÁ¿vµÄÁ´½ÓÊôÐÔ±ØÐëÊÇÍâÁ´½Ó£¨external£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ