0

i have line:

#define REPORT_HEADINGS_1   "\n   Employee          Pay      Reg Hrs   Gross      Fed      SSI      Net\n"

but when I document my source code (print it to pdf for ex) it is too long and it wraps it up

when I try to insert a line break after REPORT_HEADINGS_1

#define REPORT_HEADINGS_1
"\n   Employee          Pay      Reg Hrs   Gross      Fed      SSI  Net\n"

it fixes the wrapping problem but the compiler won't read it anymore as it should. I know it's kind of a stupid question but I'm sure there is a easy fix to it.

Thanks in advance

3
Contributors
6
Replies
7
Views
10 Years
Discussion Span
Last Post by iamthwee
0

maybe...

/* main.c */
#include <stdio.h>

#define REPORT_HEADINGS_1 printf("\n   Employee    \
 Pay      Reg Hrs  \
 Gross      Fed      SSI Net\n");

int main ( void )
{
  REPORT_HEADINGS_1
  return 0;
}
0
#define REPORT_HEADINGS_1 printf("\n   Employee    " \
 "Pay      Reg Hrs  " \
 "Gross      Fed      SSI Net\n");

The \ at the end of each line folds long lines for the benefit of the pre-processor.

The compiler will then join "string " "literals" into "string literals" for you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.