Re: Pse, help me to understand this code



On 2005-10-30, Keith Thompson <kst-u@xxxxxxx> wrote:
> Jordan Abel <jmabel@xxxxxxxxxx> writes:
>> On 2005-10-28, __frank__ <non.scrivermi@xxxxxxxxxxxxxxxxxxxx> wrote:
>>> /*********************************************/
>>> /*/ DAQmx Configure Code
>>> /*********************************************/
>>
>> What is this? You do realize that if you did a multiline comment in
>> this style every second line wouldn't be commented, right?
>
> Actually, that's not correct. Of the three lines, the first is a
> valid comment. The leading "/*" on the second line introduces a
> second comment, which is terminated by the trailing "*/" on the third
> line.
>
> It's confusing because there's a "*/" on the second line that doesn't
> close a comment (because the '*' is part of the "/*" that introduces
> it), and a "/*" on the third line that doesn't introduce a comment
> (because it's already within a comment, and comments don't nest).

That's what i was trying to say - _this_ happens to be a valid
comment (well, two comments) but if he tried to do

/******/ /*/ 1 /*/ 2 /*/ 3 /*/ 4 /******/
it would become
/*....*/ /*.....*/ 2 /*.....*/ 4 /*....*/

and
/******/ /*/ 1 /*/ 2 /*/ 3 /******/
becomes
/*....*/ /*.....*/ 2 /*..........*/

> It's horrible style, requiring too much effort by the reader to
> confirm that it's valid, but it's not actually wrong.
.



Relevant Pages

  • Re: do/end vs braces
    ... Joe Van Dyk wrote: ... end for multiline stuff. ... -- Benjamin Franklin ... Prev by Date: ...
    (comp.lang.ruby)
  • multiline Static
    ... I have derived a class from CStatic to set the background and foreground ... I want to make the text multiline. ... Malcolm Clarke ... Prev by Date: ...
    (microsoft.public.vc.mfc)
  • Re: multiline Static
    ... > I have derived a class from CStatic to set the background and foreground ... I want to make the text multiline. ... > Malcolm Clarke ... Prev by Date: ...
    (microsoft.public.vc.mfc)
  • Multline -textbox
    ... How can I limit the line for the user to input in the "multiline - textbox ... >From Agnes ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)