0

I am using CPP to expand a test file based on multiple headers. Pre processed file is used by other scripts.

When i use EXPAND_SPEC define. I want the CPP to put following lines in file.

A B
C D
E F

So i tried using following define

#define EXPAND_SPEC\
A B \
C D \
E F

But, CPP replaces this define in following fashion

A B C B E F

How to get new line character using define.

Shubham Bhave
  • 383
  • 6
  • 17
user2268152
  • 108
  • 1
  • 2
  • 9

1 Answers1

0

Your request is impossible.

You cannot create new lines with the C/C++ pre-processor.

The only solution is to use a different macro processor or have your macro embed a special character (or string) that can be replaced with a new line using a text manipulation utility like SED or AWK. Both are part of cygwin.

egur
  • 7,830
  • 2
  • 27
  • 47