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

C preprocessor

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 of translation. The preprocessor handles directives for source file inclusion (#include), macro definitions (#define), and conditional inclusion (#if). The language of preprocessor directives is agnostic to the grammar of C, so the C preprocessor can also be used independently to process other types of files.
The transformations it makes on its input form the first four of C's so-called Phases of Translation. Though an implementation may choose to perform some or all phases simultaneously, it must behave as if it performed them one-by-one in order.
Contents
[hide]
1 Phases
2 Including files
3 Conditional compilation
4 Macro definition and expansion
4.1 Standard predefined positioning macros
4.2 Precedence
4.3 Multiple lines
4.4 Multiple evaluation of side effects
4.5 Token concatenation
4.6 Semicolons
4.6.1 Multiple statements
4.7 Quoting macro arguments
4.7.1 Indirectly quoting macro arguments
4.8 Variadic macros
4.9 X-Macros
4.10 Compiler-specific predefined macros
5 User-defined compilation errors and warnings
6 Compiler-specific preprocessor features
7 As a general-purpose preprocessor
8 See also
9 References
10 External links
[edit] Phases
The following are the first four (of eight) phases of translation specified in the C Standard:
Trigraph Replacement - The preprocessor replaces trigraph sequences with the characters they represent.
Line Splicing - Physical source lines that are continued with escaped newline sequences are spliced to form logical lines.
Tokenization - The preprocessor breaks the result into preprocessing tokens and whitespace. It replaces comments with whitespace.
Macro Expansion and Directive


Ïà¹ØÎĵµ£º

ÈçºÎʹÓ÷ºÐÍÄ£擬virtual? (C/C++) (template)

ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......

ÉîÈëC/C++Ö®»ùÓÚCheckStackVarsµÄ°²È«¼ì²é£¨VS2008£©

×î½üһֱæ±ÏÒµµÄÏà¹ØÊÂÇ飬¼ÓÉϹ¤×÷£¬×ªÑۼ䣬ÓÖµ½Ôµ×ÁË£¬Ö®Ç°³ÐŵµÄÿÔÂһƪ²©ÎÄ£¬Ç°¼¸Ìì¾ÍÒ»Ö±ÔÚÑ°ÕÒµ½µ×Ҫдʲô£¬½üÁ½ÌìÓÖͻȻ·¢ÏÖÓкܶණÎ÷¿ÉÒÔд¡£±¾Æª¾ÍÏÈÑÓÐø֮ǰµÄһƪ»ùÓÚCookieµÄ°²È«¼ì²é»úÖÆ£¨ÉîÈëC/C++Ö®»ùÓÚCookieµÄ°²È«¼ì²é£¨VS2005£©£©À´½éÉÜÏÂÁíÍâÒ»ÖÖÔÚDEBUG°æ±¾Ïµİ²È«¼ì²é£¬Ò²¾ÍÊÇCheckStackVars¼ì ......

ÔÚEclipseϵÄC/C++¿ª·¢£¨Eclipse3.2 + CDT 3.1£©


ÒªÈàEclipse ¿ÉÒÔ¿ª·¢ C/C++ ³Ìʽ£¬Òª¹ÒÉÏ CDT ²Å¿ÉÒÔ¡£
 
Ê×ÏÈÒªÏÂÔØCDT
 
CDTµÄ×îа汾ÊÇ 3.1.0£¬ËüÖ§³Öeclipse3.2.0£¬ÆäÏÂÔصØÖ·£ºhttp://download3.eclipse.org/tools/cdt/releases/callisto/dist/3.1.0/£¬»òÕßÊǵ½http://www.eclipse.org/cdt/downloads.phpÏÂÔØÆäËü° ......

ÓÃcʵÏÖ±³°üÎÊÌ⣨̰ÐÄ£©

ºÃ¾ÃÒÔÇ°×öµÄÒ»¸ö³ÌÐò£¬Ì°ÐIJßÂÔʵÏÖ±³°üÎÊÌ⣬cʵÏÖ¡£
×ܽáÔÚÕâÀÒÔ±¸ÒÔºóºÍ±ðÈ˲éÕÒ¡£
//±³°üÎÊÌâ
#include "stdio.h"
#define MAX 10
void main()
{
 int w[MAX]={0,10,130,15,60,25};      //´æ·ÅÖÊÁ¿
 int v[MAX]={0,30,5,10,20,25};   //´æ·Å¼ÛÖµ
 flo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ