BUY TELUGU TUTORIAL DVD'S:::: SEO::3500/-,DCA(DOS,WINDOWS,WORD,EXCEL,POWER POINT, MS ACCESS, INTERNET CONCEPTS)::499/-,DTP(PHOTOSHOP,PAGEMAKER, CORELDRAW,TELUGU TYPING)::999/-,C::700,C++::900,TALLY ERP 9:: 999,ORACLE:999/-,CORE JAVA::1000/-,SPOKEN HINDI:500,HTML::500/-,AUTOCAD::2500/-,DCA+DTP::1000/-,DCA+TALLY::1000,C,C++,JAVA::1500, ALL COURSES(DCA,DTP,C,C++,JAVA,ORACLE,TALLY,HTML,SPOKEN HINDI,AUTOCAD):: 3500/-..CONTACT : SYED HAFIZ, SHOPPING COMPLEX,8INCLINE COLONY,GODAVARI KHANI,KARIMNAGAR, TELANGANA,CELL:9395306603,EMAIL:COOLHAFI7@GMAIL.COM.
Home / c++ / C++ video tutorials in telugu about comment Part 4

C++ video tutorials in telugu about comment Part 4

c++ video tutorials in telugu

Program comments are explanatory statements that you can include in the C++ code that you write and helps anyone reading it’s source code. All programming languages allow for some form of comments.

C++ supports single-line and multi-line comments. All characters available inside any comment are ignored by C++ compiler.

C++ comments start with /* and end with */. For example:

/* This is a comment */

/* C++ comments can  also
 * span multiple lines
 */

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

#include <iostream>
using namespace std;

main()
{
   cout << "Hello World"; // prints Hello World

   return 0;
}

When the above code is compiled, it will ignore // prints Hello World and final executable will produce the following result:

Hello World

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 printing of Hello World:

cout << "Hello World"; // prints Hello World

*/

Comments are portions of the code ignored by the compiler which allow the user to make simple notes in the relevant areas of the source code. Comments come either in block form or as single lines.

  • Single-line comments (informally, C++ style), start with // and continue until the end of the line. If the last character in a comment line is a the comment will continue in the next line.
  • Multi-line comments (informally, C style), start with /* and end with */.
 Note:
 Some compilers may generate errors/warnings.
 Try to avoid using C style inside a function because of the non nesting facility of C style (most editors now have some sort of coloring ability that prevents this kind of error, but it was very common to miss it, and you shouldn't make assumptions on how the code is read).

 

About Hafiz

Check Also

C++ tutorial for beginners in telugu Part 1

c++ tutorial for beginners in telugu In this Video Tutorial you can learn c++ in …

Leave a Reply

Your email address will not be published. Required fields are marked *

STATE BANK OF HYDERABAD, ***NAME:Hafiz SD, BRANCH:JALLARAM, ACCOUNT.NO:62041435239, IFSC CODE:SBHY0020609,****, ANDRA BANK*** NAME:SYED HAFEEZ BABA, BRANCH:8INCLINE COLONY, ACCOUNT.NO:116710100037533****SBI****NAME:SYED HAFEEZ BABA,ACCOUNT NO:35321924009,IFSC CODE:SBIN0013338,BRANCH:GODAVARIKHANI.,...