C Tutorial/Preprocessor/ifndef — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
(нет различий)

Версия 14:21, 25 мая 2010

ifndef

#ifndef is used to check whether a particular symbol is defined.


#define USA 1
//#define EUP 1
#include <stdio.h>
#ifndef USA            
   #define currency_rate 100    
#endif               
#ifndef EUP                 
   #define currency_rate 46
#endif               
main()
{
    int rs;
    rs = 10 * currency_rate; 
    printf ("%d\n", rs);
}
460