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."

    Not necessarily.

    For example, an if statement is a single statement (possibly including an else clause) - but it is very common indeed to split it over many lines!

    Another example: a function call is a single statement:

    func( a, b, c );
    

    but it can be quite helpful to split it over several lines:

       func
       (
           a, // document the 1st parameter
           b, /* document the 2nd parameter */
           c  // document the 3rd parameter
       );
    

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

    Not necessarily.

    For example, an if statement is a single statement (possibly including an else clause) - but it is very common indeed to split it over many lines!

    Another example: a function call is a single statement:

    func( a, b, c );
    

    but it can be quite helpful to split it over several lines:

       func
       (
           a, // document the 1st parameter
           b, /* document the 2nd parameter */
           c  // document the 3rd parameter
       );
    

Children