Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c±ê×¼

developerWorks Öйú > Linux > Óà C99 ½øÐпª·ÅÔ´´úÂëµÄ¿ª·¢ÄúµÄ C ´úÂë·ûºÏ±ê×¼Â𣿠ÎĵµÑ¡Ïî ´òÓ¡±¾Ò³ ½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ ¼¶±ð£º ³õ¼¶ Peter Seebach (developerworks@seebs.plethora.net), ×ÔÓÉ×÷¼Ò 2004 Äê 4 Ô 01 ÈÕ C99 ÊÇʲô£¿Ë­ÐèÒªËü£¿Ëü¿ÉÓÃÁËÂð£¿Poter Seebach ÌÖÂÛÁË ISO C ±ê×¼µÄ 1999 ÄêÐÞ¶©°æ£¬×ÅÖØÓÚ Linux ºÍ BSD ϵͳÉÏÐÂÌØÐԵĿÉÓÃÐÔ¡£¿ª·ÅÔ´´úÂë²Ù×÷ϵͳËù´øµÄ gcc ·¢Ðа汾²¢²»Ö§³Ö C99 µÄËùÓÐÐÂÌØÐÔ£¬²»¹ýÏÖÔÚÒѾ­ÓÐ×ã¹»¶àµÄÐÂÌØÐÔÆÕ±é¿ÉÓã¬Òò´ËÓÐÀíÓÉ¿ªÊ¼ÈÏÕ濼ÂÇÔÚеĿª·¢ÖвÉÓà C99 ÌØÐÔ£¬ÓÈÆäÊÇÓÃÔÚËüÃÇʹµÃЧÂʺÍÇåÎú¶È±¾ÖÊÉÏ·¢Éú±ä»¯µÄÄÇЩµØ·½¡£ ±¾ÎĻعËÁ˽üÀ´·¢²¼µÄ Linux ºÍ BSD É쵀 C99 ÓïÑԺͿâÌØÐԵĿÉÓÃÐÔ¡£ÓÉÓÚÕâЩÌØÐԺܶàÊÇ gcc µÄ±ê×¼ÌØÐÔ£¬ËùÒÔа汾µÄ gcc Ôڴ󲿷ÖÆäËûƽ̨ÉÏ¿ÉÒÔ×öͬÑùµÄÊÂÇé¡£µ±È»£¬¸÷¸ö·¢Ðа汾»òÕ߸÷¸ö OS Ö®¼äµÄ¿âÖ§³ÖÊDz»Í¬µÄ¡£ ÒÔÓïÑÔ±ê×¼µ÷Óà gcc GNU C ±àÒëÆ÷Ö§³ÖÐí¶à²»Í¬°æ±¾µÄ C ±à³ÌÓïÑÔ¡£¿ÉÒÔÔÚÃüÁîÐÐÉÏͨ¹ý -std Ñ¡ÏîÀ´Ñ¡ÔñËùʹÓÃµÄ C ±ê×¼µÄ°æ±¾¡£Ä¬ÈÏÑ¡ÔñµÄ²»ÊÇÈκΰ汾µÄ±ê×¼£¬¶øÊÇ“GNU C”ÓïÑÔ£¬ÕâÃÅÓïÑÔÓÐÆä×Ô¼ºµÄÀ©Õ¹¼¯¡£ C ±ê×¼µÄ³£¼û°æ±¾ÓÃÏÂÃæµÄÑ¡ÏîÑ¡Ôñ£º C-ninety-what? C99 ±ê×¼ÊÇ ISO C ±ê×¼µÄ×îÐÂÐÞ¶©°æ±¾¡£»òÐíÓ¦¸ÃÏȽéÉÜһЩÀúÊ·±³¾°¡£ÔÚÔçÆÚ£¬C ÓïÑԵĿª·¢Ã»ÓÐ×éÖ¯£¬¾­ÀúÁ˺ܶà±ä»¯¡£×îºó£¬´ó²¿·Ö³§¼Ò¶¼½ÓÊÜÁË Kernighan ºÍ Ritchie µÄ The C Programming Language µÚÒ»°æ (1978) ÖÐÃèÊöµÄÓïÑÔ£¬µ«ÊÇÀ©Õ¹»¹ÊÇ˾¿Õ¼û¹ß¡£ANSI ¿ªÊ¼ÖÂÁ¦ÓÚ»ùÓÚ´ËÊéºÍÏÖÓÐʵ¼ÊÓ¦ÓÃÖ®Éϵıê×¼£¬µ½ 1989-1990 ʱ£¬Ò»¸ö±ê×¼µÃµ½Á˹㷺µÄʹÓá£Õâ¸ö±ê×¼¾ÍÊǹ㷺Á÷´«µÄ“C89”£»ÓÐЩÈËÏ·³ÆÔÚ K&R µÄ 1978 °æÖÐÃèÊöµÄÓïÑÔΪ“C78”¡£ÔÚ½ÓÏÂÀ´µÄÊ®Ä꣬±àÒëÆ÷³§É̲»¶Ï¿ª·¢ÐÂÀ©Õ¹ºÍÐÂÌØÐÔ£¬²¢ÔÚ 1999 Äê·¢²¼ÁËÐÞ¶©µÄ±ê×¼£¬Õâ¸ö±ê×¼ÃèÊöÁ˶àÄêÀ´Ëù×öµÄ¶ÔÖÚ¶à×îÓÐÓú͹ãΪ֧³ÖµÄÐÂÌØÐÔËù½øÐеıê×¼»¯¹¤×÷¡£Õâ¸ö±ê×¼¾­³£±»½Ð×ö“C99”±ê×¼¡£ -std=c89 »ò -std=iso9899:1990 ×î³õµÄ C89 ±ê×¼ -std=iso9899:199409 C89£¬Ôö¼ÓÁË Normative Addendum 1 µÄ±ä»¯ -std=c99 or -std=iso9899:1999 C99 ÐÞ¶©°æ±ê×¼ ʹÓà -pedantic Ñ¡ÏîÀ´Ç¿ÖÆ×ñ´Óij¸ö°æ±¾µÄ±ê×¼¡£Õâ¸öÑ¡ÏîÖ÷ÒªÓÃÓÚÉ跨ȷ±£ÄúµÄ´úÂëǨÒƵ½ÆäËû±àÒëÆ÷ʱÈÔ¿ÉÓã»ÀýÈ磬Èç¹ûÄúÕýÔÚÓ벻ʹÓà gcc µÄÈ˹²ÏíÒ»¸ö´úÂë¿â (codebase)£¬Äú¿ÉÄÜÏ£ÍûËüÔÚÈκÎʱºò¶¼ÄÜÓá£×¢Ò⣬ -ped


Ïà¹ØÎĵµ£º

50¸öC/C++Ô´ÂëÍøÕ¾

C/C++ÊÇ×îÖ÷ÒªµÄ±à³ÌÓïÑÔ¡£ÕâÀïÁгöÁË50ÃûÓÅÐãÍøÕ¾ºÍÍøÒ³Çåµ¥£¬ÕâЩÍøÕ¾Ìṩc/c++Ô´´úÂë¡£Õâ·ÝÇåµ¥ÌṩÁËÔ´´úÂëµÄÁ´½ÓÒÔ¼°ËüÃǵÄС˵Ã÷¡£ÎÒÒѾ¡Á¦°üÀ¨×î¼ÑµÄC/C++Ô´´úÂëµÄÍøÕ¾¡£Õâ²»ÊÇÒ»¸öÍêÕûµÄÇåµ¥£¬ÄúÓн¨Òé¿ÉÒÔÁªÏµÎÒ£¬ÎÒ½«»¶Ó­ÄúµÄ½¨Ò飬ÒÔ½øÒ»²½¼ÓÇ¿Õâ·½ÃæµÄÇåµ¥¡£
1¡¢http://snippets.dzone.com/tag/c/ --ÊýÒÔǧ¼Æ ......

C/C++ÄÚ´æ·ÖÅä


#include <iostream>
using namespace std;
void main()
{
 char *p,*q;
 p = "abcde";
 q = p + 3;
 *q = 't';
 cout<<p<<endl;
 cout<<q<<endl;
}
Á½ÖÖÓïÑÔ±àÒ붼¿ÉÒÔͨ¹ý
µ±Ö´Ðе½
 *q = 't';
ʱ£¬C++³ÌÐò³öÏÖÄÚ´æ·ÃÎÊ´íÎó£¬C³ÌÐò¿ÉÒ ......

B/S C/S


C/SģʽºÍB/SģʽµÄÇø±ð 
¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
¡«¡«Ê²Ã´ÊÇB/Sģʽ     
      B/Sģʽ£¬¼´ä¯ÀÀÆ÷/·þÎñÆ÷ģʽ£¬ÊÇÒ»ÖÖ´Ó´«Í³µÄ¶þ²ãCSģʽ·¢Õ¹ÆðÀ´µÄеÄÍøÂç½á¹¹Ä£Ê½£¬Æä±¾ÖÊÊÇÈý²ã½á¹¹C/Sģʽ¡£B/SÍøÂç½á¹¹Ä£Ê½ÊÇ»ùÓÚIntr ......

c/c++Í·Îļþ£¬±£´æ£¬±¸ÓÃ

 
C¡¢´«Í³ C++
#include <stdio.h>¡¡¡¡¡¡¡¡ //¶¨ÒåÊäÈ룯Êä³öº¯Êý
#include <stdlib.h>¡¡¡¡¡¡¡¡//¶¨ÒåÔÓÏÊý¼°ÄÚ´æ·ÖÅ亯Êý
#include <string.h>¡¡¡¡¡¡¡¡//×Ö·û´®´¦Àí
#include <assert.h>¡¡¡¡¡¡¡¡//É趨²åÈëµã
#include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àí
#include <errno.h&g ......

Cº¯Êý¿â½éÉÜ: string.h¡¢mem.h

²Ù×÷º¯Êý,ËùÔÚº¯Êý¿âΪstring.h¡¢mem.h
mem…²Ù×÷´æÖüÊý×é
void *memccpy(void *destin,void *source,unsigned char ch,unsigned n)
void *memchr(void *s,char ch,unsigned n)
void *memcmp(void *s1,void *s2,unsigned n)
int   memicmp(void *s1,void *s2,unsigned n)
void *memmove(void *destin ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ