Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Short C++ program for comment pairs?

Could any of you tell me where I can find a short program--not one to buy--to search C++ code for unpaired block comment symbols? That is, one that has only an opening or closing symbol rather than both. If not, could you give me some hints on how to write one? Thanks so much in advance.

formeng

Update:

I'm having problems with the 2-character symbol.

2 Answers

Relevance
  • 1 decade ago

    Your C++ IDE or compiler should tell you about this. Visual Studio will display "IntelliSense: comment unclosed at end of file" and point at the offending opening comment. Similarly an unmatched */ will produce an error (although not as meaningful).

    If you want to write the code yourself you probably need to investigate regular expressions.

  • ?
    Lv 4
    5 years ago

    struct coord{ //A coordinate has x and y dimensions. int x; int y; }; struct rectangle{ // A rectangle might want to be defined with suggestions from 2 factors (coordinates) celebration lower than. struct coord *topleft; struct coord *bottomrt; }; //you may outline a rectangle in basic terms with 2 factors, using the indisputable fact that is effortless to calculate the different 2 factors. *--+ |....| +--* You outline it with the * factors, and the + factors might want to be calculated with the others. some thing of the code is in basic terms math.

Still have questions? Get your answers by asking now.