|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all,
What is the scope of preprocessor #define? Does it depends on the compiler? Thanks Ivan |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"Ivan" <idiprima@hotmail.com> wrote:
> What is the scope of preprocessor #define? From that point on to the end of the file, or to a corresponding #undef if there is one. > Does it depends on the compiler? No. Richard |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Jan 31, 4:21 pm, "Ivan" <idipr...@hotmail.com> wrote:
> Hi all, > > What is the scope of preprocessor #define? > Does it depends on the compiler? anything below the #define line until the end of file, it does not depend from the compiler. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
"Ivan" <idiprima@hotmail.com> wrote in message > > What is the scope of preprocessor #define? > Does it depends on the compiler? > File scope, in all conforming implementations. However #defines are frequently placed in headers which are #included by more than one dot c file. Some compilers separate out the preprocessing step from compilation proper. Preprocessing manages the instructions that start with a hash. However this will be transparent to you unless you invoke the preprocessor only (typically the command is cpp or similar). -- Free games and programming goodies. http://www.personal.leeds.ac.uk/~bgy1mm |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Jan 31, 8:24am, r...@hoekstra-uitgeverij.nl (Richard Bos) wrote:
> "Ivan" <idipr...@hotmail.com> wrote: > > What is the scope of preprocessor #define? > > From that point on to the end of the file, or to a corresponding #undef > if there is one. More precisely to the end of the translation unit (or #undef). "End of the file" is somewhat ambiguous during preprocessing without additional qualification. |
|
![]() |
| Outils de la discussion | |
|
|