This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Breaking instructions into two lines

Hi everyone,

How can I break a long instruction line into two or three lines to improve readability of the program written in " C language ?

Best regards,
Deepak

Parents
  • if you need to break a C statement into many lines, I would hate to read your C.

    I know that "real C" is the attempt to write the entire program in one statement, but IMHO it STINKS.

    for example

    for ( .. ; a,b,c,d ; ...)
    is difficult to read and almost impossible to comment in a sesible fashion

    can be so much more readable (and compiles more compact) if written
    for ( ... ; a ; ....)
    { ...
    if (b) break; // comment
    ...
    if (c) break; // comment
    ...
    if (d) break; // comment
    ...
    }

    Erik

Reply
  • if you need to break a C statement into many lines, I would hate to read your C.

    I know that "real C" is the attempt to write the entire program in one statement, but IMHO it STINKS.

    for example

    for ( .. ; a,b,c,d ; ...)
    is difficult to read and almost impossible to comment in a sesible fashion

    can be so much more readable (and compiles more compact) if written
    for ( ... ; a ; ....)
    { ...
    if (b) break; // comment
    ...
    if (c) break; // comment
    ...
    if (d) break; // comment
    ...
    }

    Erik

Children