include command

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron

    include command

    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.

  • Victor Bazarov

    #2
    Re: include command

    "Ron" <no@spam.com> wrote...[color=blue]
    > 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[/color]
    standard[color=blue]
    > 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.[/color]

    #define LT <
    #define GT >

    #include LT HEADER_NAME_FRO M_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


    Comment

    Working...