PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > #define
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
#define

Réponse
 
LinkBack Outils de la discussion
Vieux 31/01/2008, 14h21   #1
Ivan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut #define

Hi all,

What is the scope of preprocessor #define?
Does it depends on the compiler?

Thanks
Ivan


  Réponse avec citation
Vieux 31/01/2008, 14h24   #2
Richard Bos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: #define

"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
  Réponse avec citation
Vieux 31/01/2008, 14h33   #3
vippstar@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: #define

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.
  Réponse avec citation
Vieux 31/01/2008, 14h34   #4
Malcolm McLean
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: #define


"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


  Réponse avec citation
Vieux 31/01/2008, 19h57   #5
robertwessel2@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: #define

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08132 seconds with 13 queries