c ÓïÑÔÖдøconst µÄÖ¸ÕëС¼Ç
Ò»¡¢ÓÐÈçÏ´úÂ룺
int age = 25;
const int *pAge = &age;
ÉÏÃæµÄ´úÂë±íʾ£º
1¡¢Ö¸Õë±äÁ¿pAge´æ·Å±äÁ¿ageµÄµØÖ·£¬ÇÒ²»ÄÜͨ¹ý *pAge = 30£¬À´¸Ä±äÖ¸Õë±äÁ¿pAgeËùÖ¸ÏòµÄ´æ´¢¿Õ¼äµÄÖµ£¬µ«ÊÇ ¶ÔÓÚ age = 30£¬ÔòÊÇûÓÐÎÊÌâµÄ¡£
2¡¢pAge ±¾Éí¿ÉÒÔÔÙ´æ·ÅÆäËü±äÁ¿µÄµØÖ·£¬Ò²¿ÉÒÔÖ¸ÏòNULL£¬Èç pAge = NULL;ÊÇÕýÈ·µÄ¡£
¶þ¡¢ÓÐÈçÏ´úÂ룺
int age = 25;
int *const pAge = &age;
ÉÏÃæµÄ´úÂë±íʾ£º
1¡¢Ö¸Õë±äÁ¿pAgeÓÃconstÏÞ¶¨ÁË£¬ËùÒÔpAge²»ÄÜÔÙ´æ´¢ÆäËü±äÁ¿µÄÖµ£¬Ò²²»ÄÜÖ¸ÏòNULL;ËùÒÔ pAge = NULL;ÊDz»ÕýÈ·µÄ
2¡¢¶ÔÓÚ*page = 30£¬ÊÇÕýÈ·µÄ;
Èý¡¢ÓÐÈçÏ´úÂ룺
int age = 25;
const int *const pAge = &age;
ÉÏÃæµÄ´úÂë±íʾ£º
1¡¢Ö¸Õë±äÁ¿pAge²»ÄÜÔÙ´æ´¢ÆäËü±äÁ¿µÄÖµ»òNULL
2¡¢¶ÔÓÚͨ¹ý*pAge = 30 µÄÐÎʽ¸Ä±äÖ¸Õë±äÁ¿pAgeÖ¸ÏòµÄ´æ´¢¿Õ¼äµÄÖµÊDz»ÕýÈ·µÄ
3¡¢¶ÔÓÚ age = 30 ûÓÐÎÊÌâ
Ïà¹ØÎĵµ£º
¹¹½¨»ù±¾µÄLinux C ±à³Ì»·¾³ ÊÕ²Ø
±¾ÎÄ»ùÓÚdebian-40r0(ÄÚºË2.6.18)½éÉÜÒ»ÏÂÈçºÎÔÚÒ»¸ö±ê׼ϵͳÖй¹½¨Linux CµÄ»ù±¾±à³Ì¿ª·¢»·¾³¡£
Ò»¸öÍêÕûµÄ¿ª·¢»·¾³Ö÷Òª°üÀ¨Ëĸö²¿·Ö£º±ê×¼C¿â¡¢Í·Îļþ¡¢¹¤¾ßÁ´¡¢±à¼Æ÷¡¢°ïÖúÎĵµ£¬ÏÂÃæÒÀ´Î½éÉÜ¡£
±ê×¼C¿âglibc
glibcÊÇgnu·¢²¼µÄlibc¿â£¬¼´cÔËÐп⡣glibcÊÇlinuxϵͳÖÐÄÚºËÖ ......
ÀûÓÃc.vim²å¼þ£¬Äã¿ÉÒÔʵÏÖ
Ìí¼ÓÎļþÍ·
Ìí¼Ó×¢ÊÍ
²åÈëһЩ´úÂëƬ¶Î
Óï·¨¼ì²é
¶Áº¯ÊýÎĵµ
×¢ÊÍ´úÂë¿é
ÕâÒ»²å¼þµÄ×÷ÕßÊÇ Fritz Mehner, Ä¿±ê¾ÍÊÇ´òÔì³ÌÐòÔ±Á÷³©µÄ±à¼»·¾³¡£
ÕâÒ»²å¼þ»¹ÄÜÍê³É:
Statement oriented editing of C / C++ programs
Speed up writing new code considerably.
Write code and ......
1.ÇóÏÂÃ溯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
}
......
#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100
main()
{
FILE *fp;
if ( (fp = fopen( "c:\\a.txt", "r" )) == NULL ) printf("ERROR!\n");
int tmp[MAXSIZE];
int i;
for ( i=0; i<MAXSIZE; i++ )
{
tmp[i] = 0; ......
Turbo C 2.0 º¯ÊýÖÐÎÄ˵Ã÷´óÈ«
·ÖÀຯÊý,ËùÔÚº¯Êý¿âΪctype.h
int isalpha(int ch) ÈôchÊÇ×Öĸ('A'-'Z','a'-'z')·µ»Ø·Ç0Öµ,·ñÔò·µ»Ø0
int isalnum(int ch) ÈôchÊÇ×Öĸ('A'-'Z','a'-'z')»òÊý×Ö('0'-'9'),·µ»Ø·Ç0Öµ,·ñÔò·µ»Ø0
int isascii(int ch) ÈôchÊÇ×Ö·û(ASCIIÂëÖеÄ0-127)·µ»Ø·Ç0Öµ,·ñÔò·µ»Ø0
int iscntrl(int ......