CÏÝÚå&ȱÏÝ
1.1= Óë ==
Àý1£º
±¾ÀýÖÐÑ»·Óï¾äµÄ±¾ÒâÊÇÌø¹ýÎļþÖеĿոñ·û¡¢ÖƱí·û¡¢»»Ðзû
while(c=''||c=='\t'||c=='\n')
c=getc(f);
c= ''||c=='\t'||c=='\n'
ËÀÑ»·
Àý2£º
if((filedesc==open(argv[i],0))<0)
error();
ÓÀÔ¶²»»á±»µ÷ÓÃ
1.2 & ºÍ | ²»Í¬ÓÚ&& ºÍ||
1.3 CÓïÑÔÔËËã·û
a---b <==> a-- -b
a - --b
y=x/*p ±íʾעÊÍ -¡·y=x/(*p)
1.4 ÕûÐͳ£Á¿
1.5 ×Ö·ûºÍ×Ö·û´®
×¢£ºÓõ¥ÒýºÅÀ¨ÆðÀ´µÄÒ»¸ö×Ö·û´ú±íÒ»¸öÕûÊý
ÓÃË«ÒýºÅÀ¨ÆðÀ´µÄÒ»¸ö×Ö·û´ú±íÒ»¸öÖ¸Õë
2.1 º¯Êý
float *g() , (*h)();
*g() ¡¶==¡·*(g()) gÊÇÒ»¸öº¯Êý ¸Ãº¯ÊýµÄ·µ»ØÖµÀàÐÍΪָÏò¸¡µãÊýµÄÖ¸Õë¡£
hÊÇÒ»¸öº¯ÊýÖ¸Õë £¬hËùÖ¸ÏòµÄº¯ÊýµÄ·µ»ØֵΪ¸¡µãÀàÐÍ
3.1 Ö¸Õë Êý×é
struct
{
int p[4];
double x;
}b[17];
ÉùÃ÷ÁËbÊÇÒ»¸öÓµÓÐ17¸öÔªËØÊý×飬ÆäÖÐÿ¸öÔªËض¼ÊÇÒ»¸ö½á¹¹Ìå
*a ¾ÍÊÇÊý×éaÖÐϱêΪ0µÄÔªËØÒýÓá£
*a=84£»
Çå¿ÕÊý×é
int month;
for(month=0;month<12;month++)
{
int day;
for(day=0;day<31;day++)
{
calendar[month][day]=0;
}
}
3.1 ·ÇÊý×éµÄÖ¸Õë
¿âº¯Êýstrlen·µ»Ø²ÎÊýÖÐ×Ö·û´®Ëù°üÀ¨µÄ×Ö·ûÊýÄ¿£¬
¶ø×÷Ϊ½áÊø±êÖ¾µÄ¿Õ×Ö·û²¢Î´ÔÚ¼ÆËãÔÚÄÚ£¬Òò´Ë£¬strlen(s)
µÄÖµÊÇn£¬ÄÇô×Ö·û´®µÄʵ¼ÊÐèÒªn+1¸ö×Ö·û¿Õ¼ä¡£
char *r,*malloc();
r=malloc(strlen(s)+strlen(t)+1);
if(!r)
{
complain();
exit(1);
}
strcpy(r,s);
strcat(r,t);
/* Ò»¶Îʱ¼äÒÔºó*/
free(r);
3.3 ×÷Ϊ²ÎÊýµÄÊý×éÉùÃ÷
º¯ÊýµÄÉùÃ÷£º
int strlen(char s[])
{
/*¾ßÌåÉùÃ÷*/
}
¡¶==¡·
int strlen(char *s)
{
/*¾ßÌåÉùÃ÷*/
}
main(int argc,char *argv[])
{
/*¾ßÌåÄÚÈÝ*/
}
¡¶==¡·
main(int argc,char **argv)
{
/*¾ßÌåÄÚÈÝ*/
}
&nbs
Ïà¹ØÎĵµ£º
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. ldexpº¯Êý
ldexpº¯ÊýµÄ¹¦ÄÜÊǼÆËãvalue*2µÄÃÝ£¬ÆäÓ÷¨Îª£ºdouble ldexp(double value, int exp);³ÌÐòʵÀýÈçÏ£º
......
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. mallocº¯Êý
mallocº¯ÊýµÄ¹¦ÄÜÊÇÄÚ´æ·ÖÅ亯Êý£¬ÆäÓ÷¨Îª£ºvoid *malloc(unsigned size);³ÌÐòʵÀýÈçÏ£º
#include <stdio.h>
#i ......
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. qsortº¯Êý
qsortº¯ÊýµÄ¹¦ÄÜÊÇʹÓÿìËÙÅÅÐòÀý³Ì½øÐÐÅÅÐò£¬ÆäÓ÷¨Îª£ºvoid qsort(void *base, int nelem, int width, int (*fcmp)());³Ì ......
2005-09-12 09:16
×÷ÕߣºËᦻª
³ö´¦£ºÌ켫Íø
ÔðÈα༣º·½ÖÛ
¡¡¡¡º¯Êýmax¿´ÆðÀ´¼ò½àÃ÷ÁË£¬µ«ÊÇʵ¼ÊÉÏprintfµÄʵÏÖÈ´Ô¶±ÈÕ⸴ÔÓ¡£maxº¯ÊýÖ®ËùÒÔ¿´ÆðÀ´¼òµ¥£¬ÊÇÒòΪ£º
¡¡¡¡(1) maxº¯Êý¿É±ä²ÎÊý±íµÄ³¤¶ÈÊÇÒÑÖªµÄ£¬Í¨¹ýnum²ÎÊý´«È룻
¡¡¡¡(2) maxº¯Êý¿É±ä²ÎÊý±íÖвÎÊýµÄÀàÐÍÊÇÒÑÖªµÄ£¬¶¼ÎªintÐÍ¡£
¡¡¡¡¶øprintfº¯ÊýÔ ......
Ðí¶à±à³ÌÓïÑÔÖеĵ÷Óú¯ÊýµÄÁ½ÖÖ·½·¨ÊÇ°´Öµµ÷ÓÃ(call-by-value)ºÍ°´ÒýÓõ÷ÓÃ(call-by-reference)¡£
²ÎÊý°´Öµµ÷Óô«µÝʱ£¬Éú³É²ÎÊýÖµ¸±±¾²¢ÇÒ´«¸ø±»µ÷Óú¯Êý£¬¸±±¾µÄ¸Ä±ä²¢²»Ó°Ïìµ÷ÓÃÕßµÄÔʼ±äÁ¿Öµ£¬ÕâÑù¾Í¿ÉÒÔ·ÀÖ¹ÒâÍâµÄ¸±×÷ÓÃÓ°Ï쿪·¢ÕýÈ·£¬¿É¿¿µÄϵͳ¡£°´Öµµ÷ÓõÄÒ»¸öȱµãÊÇ£¬Èç¹û´«µÝ½Ï´óµÄÊý¾ÝÏÔò¸´ÖÆÕâ¸öÊý ......