C++ÓëCµÄÇø±ð
±±º£
1£© º¯ÊýÉùÃ÷
l CÈç¹û²»Ð´·µ»ØÖµ£¬Ä¬ÈÏÊÇint£¬¶øC++Öв»Äܲ»Ð´·µ»ØÖµ(¿ÉÓÃvoid±íʾÎÞ·µ»ØÖµ)¡£
ÈçFunc1();
l int Func1()ÔÚCÖбíʾ¿É´øÈÎÒâ²ÎÊýµÄº¯Êý£¬ÕâÊÇCµÄ©¶´£¬Ê¹µÃËü±Ü¿ªÁ˲ÎÊýÀàÐͼì²é£»¶øC++Öбíʾ²»´ø²ÎÊýµÄº¯Êý¡£
2£© Í·ÎļþµÄÇø±ð
l C++µÄÍ·ÎļþÈ¥µôÁËCÖеÄ.h£¬ÒÔcǰ׺¿ªÊ¼¡£±ÈÈ磬<stdio.h> <stdlib.h>±äΪ<cstdio> <cstdlib>
l C´ø.hµÄÊÇ·ÇÄ£°å»¯µÄÍ·Îļþ£¬¶øC++ÊÇÄ£°å»¯µÄÍ·Îļþ¡£
.hÎļþÊDz»º¬ÃüÃû¿Õ¼äµÄ£¬ËùÒÔÒÔÇ°µÄ<iostream.h>ÊDz»ÐèÒªusingµÄ¡£
µ±È»Ò²¿ÉÒÔÓÃÀϵÄCÍ·Îļþ£¬µ«ÊÇ£¬ÔÚͬһ¸ö³ÌÐòÀï²»ÄÜ»ì×ÅÓã¬ËäÈ»±àÒë¿ÉÒÔͨ¹ý£¬µ«ÊÇ¿ÉÄÜ»á³öÏÖÎÊÌâ¡£
3£© register±äÁ¿
ÔÚCÓïÑÔÖУ¬ÊDz»ÄܶÔregister±äÁ¿È¡µØÖ·µÄ£¬ÒòΪËüûÓÐÐéµØÖ·£¬ÔڼĴæÆ÷Àï¡£¶øC++ÖУ¬ËüÊÇ¿ÉÒÔÈ¡Ö·µÄ£¬Õâʱ£¬C++±àÒëÆ÷»áºöÂÔregister£¬²»»á°ÑËü·Åµ½¼Ä´æÆ÷Àï¡£
4£© const±äÁ¿
CÖУ¬constÊÇÖ»¶ÁµÄ±äÁ¿£¬²»Êdz£Á¿£»C++ÖÐËüÊdz£Á¿¡£Çø±ðÓÃÀý×ÓÃèÊöÈçÏ£º
const int MAX = 10;
char buffer[MAX]; //CÖÐËüÊDz»ºÏ·¨µÄ£¬¿ÉÒÔÓÃenum»òdefineÌæ´ú£»
//C++ÖÐËüÊǺϷ¨µÄ¡£
±¾ÖÊ£ºCÖÐconst±äÁ¿·ÖÅäÔÚÈ«¾Ö¾²Ì¬Çø£»C++ÖÐÔòÔÚ³£Á¿Çø£¬±àÒë¹ý³ÌÖÐÖµ¾Í¶¨ÁË¡£
5£© typedef
ÔÚCÖУ¬
struct A
{
};
A a; //ÕâÊÇ´íÎóµÄ£¬ÔÚC++ÖÐÊǺϷ¨µÄ¡£
struct A a; //ÕâÊÇÕýÈ·µÄ
ÓÃÁËtypedefºó£¬CÖÐA a;Ò²ÊǺϷ¨µÄÁË¡£
6£© struct/union/class
l ¶ÔÓÚstruct/unionÊý¾Ý³ÉÔ±Ó뺯Êý³ÉÔ±µÄ·ÃÎÊÐÔÀ´Ëµ£¬ÆäĬÈÏÊÇpublic£»
l classÔòÊÇprivate¡£
l unionÁªºÏÌå²»ÄÜ×÷Ϊ»ùÀà¼Ì³Ð¡£
union A
{
};
class B: public A //±àÒë³ö´í
{
};
l ÄäÃûunion
union
{
int a;
float b;
};
ÔÚ³ÌÐòÀï¿ÉÒÔÖ±½Ó·ÃÎÊ
Ïà¹ØÎĵµ£º
1¡¢http://snippets.dzone.com/tag/c/ --ÊýÒÔǧ¼ÆµÄÓÐÓõÄCÓïÑÔÔ´´úÂëƬ¶Î
2¡¢http://www.hotscripts.com/category/c-cpp/scripts-programs/ Hotscripts --ÌṩÊýÒ԰ټƵÄCºÍC++½Å±¾ºÍ³ÌÐò¡£ËùÓгÌÐò¶¼·ÖΪ²»Í¬µÄÀà±ð¡£
3¡¢http://www.planetsourcecode.com/vb/default.asp?lngWId=3 --³¬¹ýÍòÐÐCºÍC++Ãâ·ÑµÄÔ´´úÂë
4¡ ......
LinuxÏÂC++¿ª·¢¹¤¾ß½éÉÜ
¡¡¡¡¸ÅÊö
¡¡¡¡¾ÍC£«£«¿ª·¢¹¤¾ß¶øÑÔ£¬ÓëWindowsÏÂ΢Èí£¨VC£¬ VS2005µÈ£©Ò»Í³ÌìÏÂÏà±È£¬Linux/UnixÏÂC£«£«¿ª·¢£¬¿ÉνÎ廨°ËÃÅ£¬¸÷ʽ¸÷Ñù¡£Emacs, vi, eclipse, anjuta£¬kdevelopµÈ²ã³ö²»Çî¡£
¡¡¡¡WindowsÏ£¬¿ª·¢¹¤¾ß¶àÒÔ¼¯³É¿ª·¢»·¾³IDEµÄÐÎʽչÏÖ¸ø×îÖÕÓû§¡£ÀýÈ磬VS2005¼¯³ ......
http://en.wikipedia.org/wiki/C_preprocessor
C preprocessor
from Wikipedia, the free encyclopedia
Jump to:navigation, search
The C preprocessor (cpp) is the preprocessor for the C programming language. In many C implementations, it is a separate program invoked by the compiler as the first part ......
¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2
ת×Ô £º http://blog.chinaunix.net/u2/87570/showart_2120069.html
±àÒëÆ÷×öÁËЩʲô
ͼ1£º±àÒëÆ÷ͨ³£·Ö¸î³É¼¸¸ö¸üСµÄ³ÌÐò
¾²Ì¬Á´½ÓÓ붯̬Á´½Ó
  ......
½ñÌìÊÇ5ÔµÄ×îºóÒ»ÌìÁË£¬2010ÄêµÄ5Ô£¬µ¹Ã¹µÄÒ»¸öÔÂÖÕÓÚÒª¹ýÈ¥ÁË¡£½ñÌì³é¿ÕÎÒÓÖ¶ÁÍêÁ˵ÚÈýÕ£¬Ë³±ã×öϱʼǡ£
ÕâÒ»ÕµÄÌâÄ¿½Ð×ö---ÓïÒå“ÏÝÚå”
³ÌÐòÒ²ÓпÉÄܱíÃæ¿´ÉÏÈ¥ÊÇÒ»¸öÒâ˼£¬Êµ¼ÊÉϵÄÒâ˼ȴÏàÈ¥ÉõÔ¶¡£
¶ÔÓÚÊý×飺
CÓïÑÔÖÐÖ»ÓÐһάÊý×飬 ......