next up previous contents index
Next: Form der new- und Up: 50 Ways to Improve Previous: new und delete statt

C++ Kommentare benutzen

 

  if (a>b)                if (a>b)
  { int t=a;  //swap      { int t=a; /*swap*/
    a=b;                    a=b;
    b=t;                    b=t;
  }                       }

   C++-Stil               C-Stil

Auskommentieren des Rumpfes führt zu folgender Situation:

  if (a>b)                if (a>b)
  {// int t=a;  //swap    {/* int t=a; /*swap*/
   // a=b;                    a=b;
   // b=t;                    b=t;
  }                        */}

   C++-Stil               C-Stil

Der C-Kommentar hört beim ersten */ auf.


next up previous contents index
Next: Form der new- und Up: 50 Ways to Improve Previous: new und delete statt

Peter Pfahler, 1997