³¹µ×¸ã¶¨CÖ¸Õ룺¯ÊýÃûÓ뺯ÊýÖ¸Õë
º¯ÊýÃûÓ뺯ÊýÖ¸Õë
Ò» ͨ³£µÄº¯Êýµ÷ÓÃ
Ò»¸öͨ³£µÄº¯Êýµ÷ÓõÄÀý×Ó£º
//×ÔÐаüº¬Í·Îļþ
void MyFun(int x); //´Ë´¦µÄÉêÃ÷Ò²¿Éд³É£ºvoid MyFun( int );
int main(int argc, char* argv[])
{
MyFun(10); //ÕâÀïÊǵ÷ÓÃMyFun(10);º¯Êý
return 0;
}
void MyFun(int x) //ÕâÀﶨÒåÒ»¸öMyFunº¯Êý
{
printf(“%d\n”,x);
}
Õâ¸öMyFunº¯ÊýÊÇÒ»¸öÎÞ·µ»ØÖµµÄº¯Êý£¬Ëü²¢²»Íê³ÉʲôÊÂÇé¡£ÕâÖÖµ÷Óú¯ÊýµÄ¸ñʽÄãÓ¦¸ÃÊǺÜÊìϤµÄ°É£¡¿´Ö÷º¯ÊýÖе÷ÓÃMyFunº¯ÊýµÄÊéд¸ñʽ£º
MyFun(10);
ÎÒÃÇÒ»¿ªÊ¼Ö»ÊÇ´Ó¹¦ÄÜÉÏ»òÕß˵´ÓÊýѧÒâÒåÉÏÀí½âMyFunÕâ¸öº¯Êý£¬ÖªµÀMyFunº¯ÊýÃû´ú±íµÄÊÇÒ»¸ö¹¦ÄÜ£¨»òÊÇ˵һ¶Î´úÂ룩¡£
Ö±µ½——
ѧϰµ½º¯ÊýÖ¸Õë¸ÅÄîʱ¡£ÎҲŲ»µÃ²»ÔÚ˼¿¼£ºº¯ÊýÃûµ½µ×ÓÖÊÇʲô¶«Î÷ÄØ£¿
£¨²»ÒªÒÔΪÕâÊÇûÓÐʲôÒâÒåµÄÊÂàÞ£¡ºÇºÇ£¬¼ÌÐøÍùÏ¿´Äã¾ÍÖªµÀÁË¡££©
¶þ º¯ÊýÖ¸Õë±äÁ¿µÄÉêÃ÷
¾ÍÏóijһÊý¾Ý±äÁ¿µÄÄÚ´æµØÖ·¿ÉÒÔ´æ´¢ÔÚÏàÓ¦µÄÖ¸Õë±äÁ¿ÖÐÒ»Ñù£¬º¯ÊýµÄÊ×µØÖ·Ò²ÒÔ´æ´¢ÔÚij¸öº¯ÊýÖ¸Õë±äÁ¿ÀïµÄ¡£ÕâÑù£¬ÎҾͿÉÒÔͨ¹ýÕâ¸öº¯ÊýÖ¸Õë±äÁ¿À´µ÷ÓÃËùÖ¸ÏòµÄº¯ÊýÁË¡£
ÔÚCϵÁÐÓïÑÔÖУ¬ÈκÎÒ»¸ö±äÁ¿£¬×ÜÊÇÒªÏÈÉêÃ÷£¬Ö®ºó²ÅÄÜʹÓõġ£ÄÇô£¬º¯ÊýÖ¸Õë±äÁ¿Ò²Ó¦¸ÃÒªÏÈÉêÃ÷°É£¿ÄÇÓÖÊÇÈçºÎÀ´ÉêÃ÷ÄØ£¿ÒÔÉÏÃæµÄÀý×ÓΪÀý£¬ÎÒÀ´ÉêÃ÷Ò»¸ö¿ÉÒÔÖ¸ÏòMyFunº¯ÊýµÄº¯ÊýÖ¸Õë±äÁ¿FunP¡£ÏÂÃæ¾ÍÊÇÉêÃ÷FunP±äÁ¿µÄ·½·¨£º
void (*FunP)(int) ; //Ò²¿Éд³Évoid (*FunP)(int x);
Äã¿´£¬Õû¸öº¯ÊýÖ¸Õë±äÁ¿µÄÉêÃ÷¸ñʽÈçͬº¯ÊýMyFunµÄÉêÃ÷´¦Ò»Ñù£¬Ö»²»¹ý——ÎÒÃÇ°ÑMyFun¸Ä³É£¨*FunP£©¶øÒÑ£¬ÕâÑù¾ÍÓÐÁËÒ»¸öÄÜÖ¸ÏòMyFunº¯ÊýµÄÖ¸ÕëFunPÁË¡££¨µ±È»£¬Õâ¸öFunPÖ¸Õë±äÁ¿Ò²¿ÉÒÔÖ¸ÏòËùÓÐÆäËü¾ßÓÐÏàͬ²ÎÊý¼°·µ»ØÖµµÄº¯ÊýÁË¡££©
Èý ͨ¹ýº¯ÊýÖ¸Õë±äÁ¿µ÷Óú¯Êý
ÓÐÁËFunPÖ¸Õë±äÁ¿ºó£¬ÎÒÃǾͿÉÒÔ¶ÔËü¸³ÖµÖ¸ÏòMyFun£¬È»ºóͨ¹ýFunPÀ´µ÷ÓÃMyFunº¯ÊýÁË¡£¿´ÎÒÈçºÎͨ¹ýFunPÖ¸Õë±äÁ¿À´µ÷ÓÃMyFunº¯ÊýµÄ£º
//×ÔÐаüº¬Í·Îļþ
void MyFun(int x); &nb
Ïà¹ØÎĵµ£º
²Î¿¼ÍøÖ·£ºhttp://www.uclibc.org/
GNUµÄGlibcÊÇÒ»¸ö·Ç³£³è´ó¶øÍêÕûµÄ¿â£¬ÖÁÉÙ¶ÔÓÚǶÈëʽϵͳÀ´Ëµ£¬ÆäÌå»ýÏԵùýÓÚ´óÁËһЩ¡£uClibcµÄÌá³ö½ÏºÃµÄ½â¾öÁËÕâÑùÒ»¸öÎÊÌâ¡£uClibc¾¡¿ÉÄܵļæÈÝGlibc£¬´ó¶àÊýÓ¦ÓóÌÐò¿ÉÒÔÔÚºÜС»òÍêÈ«²»Ð޸ĵÄÇé¿öϾͿÉÄÜʹÓÃuClibcÌæ´úglibc¡£Í¨¹ýuClibcÀ´´úÌæGlibc£¬¿ÉÒÔÔÚ²»¸Ä±äÓ¦ÓóÌÐò¹¦Ä ......
CÓïÑÔÓÉDennis M. RitchieÔÚ1973ÄêÉè¼ÆºÍʵÏÖ¡£´ÓÄÇÒÔºóʹÓÃÕßÖð½¥Ôö¼Ó¡£µ½1978ÄêRitchieºÍBellʵÑéÊÒµÄÁíһλ³ÌÐòר¼ÒKernighanºÏдÁËÖøÃûµÄ¡¶The C Programming Language¡·£¬½«CÓïÑÔÍÆÏòÈ«ÊÀ½ç£¬Ðí¶à¹ú¼Ò¶¼³öÁËÒë±¾£¬¹úÄÚÓÐһЩCÓïÑÔÊé¾ÍÊÇÕâ±¾ÊéµÄ·Òë»òÕß±àÒë¡£ÓÉÕâ±¾Ê鶨ÒåµÄCÓïÑÔºóÀ´±»ÈËÃdzÆ×÷ K&R C¡£
Ëæ×ÅCÓ ......
CÔËÐÐʱ¿âº¯ÊýºÍAPIº¯ÊýÓÐʲôÇø±ðºÍÁªÏµÄØ£¿
CÔËÐÐʱ¿âº¯ÊýÊÇÖ¸CÓïÑÔ±¾Ê¡Ö§³ÖµÄһЩ»ù±¾º¯Êý£¬Í¨³£ÊÇ»ã±àÖ±½ÓʵÏÖµÄ
¡£
APIº¯ÊýÊDzÙ×÷ϵͳÌṩ¸øÓû§·½±ãÉè¼ÆÓ¦ÓóÌÐòµÄº¯Êý£¬ÊµÏÖһЩÌض¨µÄ¹¦ÄÜ£¬APIº¯ÊýÒ²ÊÇCÓïÑԵĺ¯Êý
ʵÏֵġ£
ËûÃÇÖ®¼äÇø±ðÊÇ£ºAPIº¯ÊýÊÇÕë¶Ô²Ù×÷ϵͳµÄ£¬CÓïÑÔÔËÐÐʱº¯ÊýÔòÊ ......
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#define MAX 1024
int get_file_count(char *root)
{
DIR *dir;
struct dirent * ptr;
int total = 0;
char path[MAX];
dir = opendir(root ......
Linux C + + Training
Syllabus
________________________________________
1, Linux Operating System
System Environment: Ubuntu GNU / Linux, RedHat Linux AS5,
FreeBSD
Course Requirements: proficient use of commonly used Linux
/ UNIX commands.
Time: 1 week.
______________________________ ......