include command

R

Ron

Following the C++ standard document (ISO/IEC 14882) a preprocessing
directive:

#include pp-tokens new-line

is permitted. So i can write

#include "myfile.h"

but i can use even an identifier writing:

#define MYFILE "myfile.h"
#include MYFILE

ok? Anyway i cannot see any example with multiple tokens (since the standard
offers this possibility). Please, can you show me one?

I'm wondering if is correct what follows :

#define MYFILEA "my
#define MYFILEB file.h"

#include MYFILEA\
MYFILEB

I think it's wrong, but i cannot see another way.

Regards.
 
V

Victor Bazarov

Ron said:
Following the C++ standard document (ISO/IEC 14882) a preprocessing
directive:

#include pp-tokens new-line

is permitted. So i can write

#include "myfile.h"

but i can use even an identifier writing:

#define MYFILE "myfile.h"
#include MYFILE

ok? Anyway i cannot see any example with multiple tokens (since the standard
offers this possibility). Please, can you show me one?

I'm wondering if is correct what follows :

#define MYFILEA "my
#define MYFILEB file.h"

#include MYFILEA\
MYFILEB

I think it's wrong, but i cannot see another way.

#define LT <
#define GT >

#include LT HEADER_NAME_FROM_COMMAND_LINE GT

This will make it possible to pass the macro HEADER... through the
command line for compiling a certain module without changing the
code. Most of the details are implementation-defined.

(at least that's my take on it)

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,146
Messages
2,570,831
Members
47,374
Latest member
anuragag27

Latest Threads

Top