Comments are added to make a program more readable to you but the compiler must ignore the
comments.
comments.
- The slash star combination is used in C for comment delimiters.
- They are illustrated in the program at hand.
- Please note that the program does not illustrate good commenting practice, but is intended to illustrate where comments can go in a program. It is a very sloppy looking program.
- The first slash star combination introduces the first comment and the star at the end of the first line terminates this comment.
- Note that this comment is prior to the beginning of the program illustrating that a comment can precede the program itself.
- Good programming practice would include a comment prior to the program with a short introductory description of the program.
- The next comment is after the "main( )" program entry point and prior to the opening brace for
the program code itself.
/* This is a comment ignored by the compiler */ main( ) /* This is another comment ignored by the compiler */ { printf("We are looking at how comments are "); /* A comment is allowed to be continued on another line */ } /* One more comment for effect */ |
0 comments:
Post a Comment