home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / COMMENTS.CPP < prev    next >
C/C++ Source or Header  |  1997-07-05  |  2KB  |  87 lines

  1. // +++Date last modified: 05-Jul-1997
  2.  
  3. /*
  4.  * Test file for REMCMMNT.C and COMMCONV.C
  5.  *
  6.  *   Jari Laaksonen
  7.  *   Arkkitehdinkatu 30 A 2
  8.  *   FIN-33720 Tampere
  9.  *   FINLAND
  10.  *   Fidonet:  2:221/360.20
  11.  *   Internet: jla@to.icl.fi
  12.  */
  13.  
  14. #include <stdio.h>
  15.  
  16. int main()
  17. {
  18. /* 
  19.   comment */ int a; /* comment continues in same line
  20. */
  21.  
  22. /* C comment */ int b; // C++ comment
  23.  
  24. /*
  25.    C comment
  26. */ int c; // C++ comment
  27.  
  28.   /**** comment ** comment ** comment ** comment ****/
  29.   //*** comment ** comment ** comment ** comment ****/
  30.  
  31.   char ch = '\"'; /* double quote but not a start of a string */
  32.  
  33.   char x1[]       // here we...
  34.     = "";
  35.   char x2[] = ""; /* ...have some... */
  36.   char x3[] = ""  /* ...empty... */ ;
  37.   char x4[] = ""; // ...strings.
  38.  
  39.   printf ("this is a string");          /* C comment */
  40.   printf ("this is \" another string"); // C++ comment
  41.   printf ("yet another \\ string");     // C++ comment
  42.  
  43. /* C comment in one line */
  44.  
  45. // C++ comment in one line
  46.  
  47. /* C comment
  48.    in several
  49.    lines
  50.    printf ("// not a comment");
  51. */
  52.  
  53. /* C comment
  54.    in several lines */
  55.  
  56. // C comment /* in C++ comment */
  57.  
  58. /* C++ comment // in C comment */
  59.  
  60. /*
  61.    C++ comment // in C comment
  62. */
  63.  
  64.   printf ("this /* is not // a comment * * ! ");
  65.   printf ("this /* is not a comment * * ! ");
  66.   printf ("this // is not a comment * * ! ");
  67.   printf ("this */ is not a comment * * ! ");
  68.  
  69. // C++ comment in \             
  70.    several        \  
  71.    lines
  72.  
  73. // C++ comment
  74. // C++ comment /
  75.  
  76. // not a multiline C++ \comment
  77.   int d;
  78.  
  79. // not a multiline C++ \ comment
  80.   int e;
  81.  
  82. /* C comment \          
  83.    C comment */
  84.  
  85.   return 0;
  86. }
  87. /* end file */