1.3 Comments

   

Comments start with /* and end with */ . These comments do not nest. For example:

 /* this is a comment /* still a comment */ int not_in_a_comment; 

A comment can also start with // , extending to the end of the line. For example:

 const int max_widget = 42; // Largest size of a widget 

Within a /* and */ comment, // characters have no special meaning. Within a // comment, /* and */ have no special meaning. Thus, you can "nest" one kind of comment within the other kind. For example:

 /* Comment out a block of code: const int max_widget = 42; // Largest size of a widget */ ///* Inhibit the start of a block comment const int max_widget = 10; // Testing smaller widget limit //*/ 

A comment is treated as whitespace. For example, str/*comment*/ing describes two separate tokens, str and ing .

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net