½ÌÄãÀí½â¸´ÔÓµÄC/C++ÉùÃ÷
Ôø¾Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) )
[10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Â𣿱¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷£ºÎÒÃÇ
½«´ÓÿÌ춼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊÎ
·ûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ룬×îºó½éÉÜÒ»¸öÄܹ»ÈÃÄã׼ȷµØÀí½âÈκÎC/C++ÉùÃ÷µÄ“ÓÒ×ó·¨Ôò”¡£ÐèҪǿµ÷һϵÄÊÇ£¬¸´ÔÓµÄC/C++ÉùÃ÷²¢²»ÊǺÃ
µÄ±à³Ì·ç¸ñ£»ÎÒÕâÀï½ö½öÊǽÌÄãÈçºÎÈ¥Àí½âÕâЩÉùÃ÷¡£×¢Ò⣺ΪÁ˱£Ö¤Äܹ»ÔÚͬһÐÐÉÏÏÔʾ´úÂëºÍÏà¹Ø×¢ÊÍ£¬±¾ÎÄ×îºÃÔÚÖÁÉÙ1024x768·Ö±æÂʵÄÏÔʾÆ÷ÉÏÔÄ
¶Á¡£
»ù´¡
ÈÃÎÒÃÇ´ÓÒ»¸ö·Ç³£¼òµ¥µÄÀý×Ó¿ªÊ¼£¬ÈçÏ£º
int n;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare n as an int”£¨nÊÇÒ»¸öintÐ͵ıäÁ¿£©¡£
½ÓÏÂÈ¥À´¿´Ò»ÏÂÖ¸Õë±äÁ¿£¬ÈçÏ£º
int *p;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare p as an int *”£¨pÊÇÒ»¸öint
*Ð͵ıäÁ¿£©£¬»òÕß˵pÊÇÒ»¸öÖ¸ÏòÒ»¸öintÐͱäÁ¿µÄÖ¸Õë¡£ÎÒÏëÔÚÕâÀïÕ¹¿ªÌÖÂÛһϣºÎÒ¾õµÃÔÚÉùÃ÷Ò»¸öÖ¸Õ루»òÒýÓã©ÀàÐ͵ıäÁ¿Ê±£¬×îºÃ½«*
£¨»ò&£©Ð´ÔÚ½ô¿¿±äÁ¿Ö®Ç°£¬¶ø²»Êǽô¸ú»ù±¾ÀàÐÍÖ®ºó¡£ÕâÑù¿ÉÒÔ
±ÜÃâһЩÀí½âÉϵÄÎóÇø£¬±ÈÈ磺
int* p,q;
µÚÒ»ÑÛ¿´È¥£¬ºÃÏñÊÇpºÍq¶¼ÊÇint*ÀàÐ͵ģ¬µ«ÊÂʵÉÏ£¬Ö»ÓÐpÊÇÒ»¸öÖ¸Õ룬¶øqÊÇÒ»¸ö×î¼òµ¥µÄintÐͱäÁ¿¡£
ÎÒÃÇ»¹ÊǼÌÐøÎÒÃÇÇ°ÃæµÄ»°Ì⣬ÔÙÀ´¿´Ò»¸öÖ¸ÕëµÄÖ¸ÕëµÄÀý×Ó£º
char **argv;
ÀíÂÛÉÏ£¬¶ÔÓÚÖ¸ÕëµÄ¼¶ÊýûÓÐÏÞÖÆ£¬Äã¿ÉÒÔ¶¨ÒåÒ»¸ö¸¡µãÀàÐͱäÁ¿µÄÖ¸ÕëµÄÖ¸ÕëµÄÖ¸ÕëµÄÖ¸Õë...
ÔÙÀ´¿´ÈçϵÄÉùÃ÷£º
int RollNum[30][4];
int (*p)[4]=RollNum;
int *q[5];
ÕâÀp±»ÉùÃ÷Ϊһ¸öÖ¸ÏòÒ»¸ö4ÔªËØ£¨intÀàÐÍ£©Êý×éµÄÖ¸Õ룬¶øq±»ÉùÃ÷Ϊһ¸ö°üº¬5¸öÔªËØ£¨intÀàÐ͵ÄÖ¸Õ룩µÄÊý×é¡£
ÁíÍ⣬ÎÒÃÇ»¹¿ÉÒÔÔÚͬһ¸öÉùÃ÷ÖлìºÏʵÓÃ
*ºÍ&£¬ÈçÏ£º
int **p1; // p1 is a pointer to a pointer to an int.
int *&p2; // p2 is a reference to a pointer to an int.
int &*p3; // ERROR: Pointer to a reference is illegal.
int &&p4; // ERROR: Reference to a reference is illegal.
×¢£ºp1ÊÇÒ»¸öintÀàÐ͵ÄÖ¸ÕëµÄÖ¸Õ룻p2ÊÇÒ»¸öintÀàÐ͵ÄÖ¸ÕëµÄÒýÓã»p3ÊÇÒ»¸öintÀàÐÍÒýÓõÄÖ¸Õ루²»ºÏ·¨£¡£©£»p4ÊÇÒ»¸öintÀàÐÍÒýÓõÄÒý
Ó㨲»ºÏ·¨£¡£©¡£
constÐÞÊηû
µ±ÄãÏë×èÖ¹Ò»¸ö±äÁ¿±»¸Ä±ä£¬¿ÉÄÜ»áÓõ½c
Ïà¹ØÎĵµ£º
CRTÔÏÈÊÇÖ¸Microsoft¿ª·¢µÄC Runtime Library£¬ÓÃÓÚ²Ù×÷ϵͳµÄ¿ª·¢¼°ÔËÐС£ºóÀ´ÔÚ´Ë»ù´¡ÉÏ¿ª·¢ÁËC++
Runtime Library£¬ËùÒÔÏÖÔÚCRTÊÇÖ¸Microsoft¿ª·¢µÄC/C++ Runtime
Library¡£ÔÚVCµÄCRT/SRCĿ¼Ï£¬¿ÉÒÔ¿´µ½CRTµÄÔ´Â룬²»½öÓÐCµÄ£¬Ò²ÓÐC++µÄ¡£
CRTÔÏȵÄÄ¿µÄ¾ÍÊÇÖ§³Ö²Ù×÷ϵͳµÄ ......
×Ö·ûÊý×éºÍ×Ö·û´®
&×Ö·ûÊý×éºÍ×Ö·û´®µÄ¸ÅÄî &×Ö·ûÊý×éµÄ³õʼ»¯
&×Ö·û´®µÄÊäÈëÊä³ö &×ۺϾÙÀý
×Ö·ûÊý×éºÍ×Ö·û´®µÄ¸ÅÄî
×Ö·ûÊý×éÊÇÔªËØÀàÐÍΪ×Ö·ûµÄÊý×é ,Ëü¼È¾ßÓÐÆÕͨÊý×éµÄÒ»°ãÐÔÖÊ ,ÓÖ¾ßÓÐijЩÌØÊâÐÔÖÊ¡£
& ......
C++Á¬½ÓOracle
ÔÚVisual C++Ï¿ª·¢Oracle¿â½Ó¿ÚÖ÷ÒªÓÐÁ½ÖÖ·½·¨¡£Ò»ÖÖ·½·¨ÊÇÀûÓÃVisual C++ÌṩµÄ¶àÖÖÊý¾Ý¿â·ÃÎʼ¼Êõ£¬È翪·ÅÊý¾Ý¿âÁ¬½ÓODBC¡¢Êý¾Ý´æÈ¡¶ÔÏóDAO¡¢¶ÔÏóÁ¬½ÓºÍǶÈëÊý¾Ý¿âOLE DBºÍActiveXÊý¾Ý¶ÔÏóADOµÈ¡£ÁíÒ»ÖÖ·½·¨ÊÇÔÚVisual C++ÖÐǶÈëSQLÓï¾ä£¬Õâ¾ÍÊÇËùÖ ......
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
/****************************************************
* º¯Êý¹¦ÄÜ: ÅжϲÎÊý·¾¶ÊÇ·ñΪ(ÕýÈ·µÄ)Ŀ¼
* º¯Êý·µ»Ø: 0Ϊ±íʾ·¾¶ÎªÎļþ,1Ϊ·ÇĿ¼.ÆäËûΪ´íÎó
* ²ÎÊý: pathÎļþÐèÒªÅжϵÄĿ¼µÄ·¾¶.
*  ......
/***************************************************
* º¯Êý˵Ã÷: Åжϵ±Ç°path²ÎÊýÊÇ·ñΪһ¸ö¿É¶ÁµÄÎļþ
* º¯Êý·µ»Ø: 0 - Îļþ¿Ì¶È 1 - ȨÏ޾ܾø -1 -º¯Êý´íÎó
* ²Î Êý : path Îļþ·¾¶.
***************************************************/
int isReadFile(const char *path)
{
&nb ......