ת]C,C++¾µäÎÊÌ⣬¼°ÃæÊÔ±ÊÊÔÌâ
1 ±à³Ì»ù´¡
1.1 »ù±¾¸ÅÄî
1. µÄÀí½â£ºconst char*, char const*, char*constµÄÇø±ðÎÊÌ⼸ºõÊÇC++ÃæÊÔÖÐÿ´Î ¶¼»áÓеÄÌâÄ¿¡£ ÊÂʵÉÏÕâ¸ö¸ÅÄî˶¼ÓÐÖ»ÊÇÈýÖÖÉùÃ÷·½Ê½·Ç³£ÏàËƺÜÈÝÒ׼ǻ졣 BjarneÔÚËûµÄThe C++ Programming LanguageÀïÃæ¸ø³ö¹ýÒ»¸öÖú¼ÇµÄ·½·¨£º °ÑÒ»¸öÉùÃ÷´ÓÓÒÏò×ó¶Á¡£ const
char * const cp; ( * ¶Á³É pointer to )
cp is a const pointer to char
const char * p;
p is a pointer to const char;
char const * p;
ͬÉÏÒòΪC++ÀïÃæûÓÐconst*µÄÔËËã·û£¬ËùÒÔconstÖ»ÄÜÊôÓÚÇ°ÃæµÄÀàÐÍ¡£
2. Ö¸Õëc
int *p[n];-----Ö¸ÕëÊý×飬ÿ¸öÔªËؾùΪָÏòÕûÐÍÊý¾ÝµÄÖ¸Õë¡£
int (*)p[n];------pΪָÏòһάÊý×éµÄÖ¸Õ룬Õâ¸öһάÊý×éÓÐn¸öÕûÐÍÊý¾Ý¡£
int *p();----------º¯Êý´ø»ØÖ¸Õ룬ָÕëÖ¸Ïò·µ»ØµÄÖµ¡£
int (*)p();------pΪָÏòº¯ÊýµÄÖ¸Õë¡£
3. Êý×éÔ½½çÎÊÌâ
ÏÂÃæÕâ¸ö³ÌÐòÖ´Ðкó»áÓÐʲô´íÎó»òÕßЧ¹û:
#define MAX 255
int main()
{
unsigned char A[MAX],i;
for (i=0;i<=MAX;i++)
A[i]=i;
}
½â´ð£ºMAX=255,Êý×éAµÄϱ귶ΧΪ:0..MAX-1,ÕâÊÇÆäÒ»,Æä¶þ µ±iÑ»·µ½255ʱ,Ñ»·ÄÚÖ´ÐÐ: A[255]=255;Õâ¾ä±¾ÉíûÓÐÎÊÌ⣬µ«ÊÇ·µ»Øfor (i=0;i<=MAX;i++)Óï¾äʱ,ÓÉÓÚunsigned charµÄÈ¡Öµ·¶Î§ÔÚ(0..255),i++ÒÔºóiÓÖΪ0ÁË..ÎÞÏÞÑ»·ÏÂÈ¥.
×¢£ºcharÀàÐÍΪһ¸ö×Ö½Ú£¬È¡Öµ·¶Î§ÊÇ[-128£¬127]£¬unsigned char [0 ,255]
4. ºÍstrcpy µÄ¸ù±¾Çø±ð£¿ C++:memset ,memcpy
#include "memory.h"
memsetÓÃÀ´¶ÔÒ»¶ÎÄÚ´æ¿Õ¼äÈ«²¿ÉèÖÃΪij¸ö×Ö·û£¬Ò»°ãÓÃÔÚ¶Ô¶¨ÒåµÄ×Ö·û´®½øÐгõʼ»¯Îª‘ '»ò‘\0'£»Àý:char a[100];memset(a, '\0', sizeof(a));
memcpyÓÃÀ´×öÄڴ濽±´£¬Äã¿ÉÒÔÄÃËü¿½±´ÈκÎÊý¾ÝÀàÐ͵ĶÔÏ󣬿ÉÒÔÖ¸¶¨¿½±´µÄÊý¾Ý³¤¶È£»Àý£ºchar a[100],b[50]; memcpy(b, a, sizeof(b));×¢ÒâÈçÓÃsizeof(a)£¬»áÔì³ÉbµÄÄÚ´æµØÖ·Òç³ö¡£
strcpy¾ÍÖ»ÄÜ¿½±´×Ö·û´®ÁË£¬ËüÓöµ½'\0'¾Í½áÊø¿½±´£»Àý£ºchar a[100],b[50];strcpy(a,b);ÈçÓÃstrcpy(b,a)£¬
Ïà¹ØÎĵµ£º
CRTÔÏÈÊÇÖ¸Microsoft¿ª·¢µÄC Runtime Library£¬ÓÃÓÚ²Ù×÷ϵͳµÄ¿ª·¢¼°ÔËÐС£ºóÀ´ÔÚ´Ë»ù´¡ÉÏ¿ª·¢ÁËC++ Runtime Library£¬ËùÒÔÏÖÔÚCRTÊÇÖ¸Microsoft¿ª·¢µÄC/C++ Runtime Library¡£ÔÚVCµÄCRT/SRCĿ¼Ï£¬¿ÉÒÔ¿´µ½CRTµÄÔ´Â룬²»½öÓÐCµÄ£¬Ò²ÓÐC++µÄ¡£
CRTÔÏȵÄÄ¿µÄ¾ÍÊÇÖ§³Ö²Ù×÷ϵͳµÄÔËÐ ......
1.cµ÷ÓÃpython:
ʵÀý´úÂ룺
main.cµ÷ÓÃtest.pyµÄ
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//main.c
#include <windows.h>
......
Windows C ³ÌÐòÉè¼ÆÈëÃÅÓëÌá¸ß
http://download.chinaitlab.com/program/files/13246.html
µ¥Æ¬»úCÓïÑÔÈëÃÅ
http://download.chinaitlab.com/program/files/12907.html
C++ ÈëÃÅ»ù´¡½Ì³Ì
http://download.chinaitlab.com/program/files/7617.html
CÓïÑÔ³£ÓÃËã·¨Ô´´úÂë
http://download.chinaitlab.com/program/files ......
Objective C 2.0 ¼òÃ÷½Ì³Ì (5) ÊôÐÔ(Property)
×÷ÕߣºAdministrator
ÖÜÁù, 2009Äê 03ÔÂ 28ÈÕ 07:47
Objective C 2.0 ΪÎÒÃÇÌṩÁËproperty¡£Ëü´ó´ó¼ò»¯ÁËÎÒÃÇ´´½¨Êý¾Ý³ÉÔ±¶Áдº¯ÊýµÄ¹ý³Ì£¬¸üΪ¹Ø¼üµÄÊÇËüÌṩÁËÒ»ÖÖ¸üΪ¼ò½à£¬Ò×ÓÚÀí½âµÄ·½Ê½À´·ÃÎÊÊý¾Ý³ÉÔ±¡£ ......
×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½£¬ÈçºÎѧϰCºÍC++²Å²»Ã£È»£¬²Å²»ÊÇÂÒѧ£¬ÏëÁËһϣ¬ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£
¡¡¡¡Ò»¼ÒÖ®ÑÔ£¬»¶ÓÅÄש¹þ¡£
¡¡¡¡1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC.
¡¡¡¡´ó¶àÊýʱºò£¬ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ£¬²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò£¬¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓÐÓõijÌÐòÔ±£¬×öÒ»¸ö׬ǮµÄ³ÌÐòÔ±¡£ÎÒÃǵļ ......