C Tutorial/Preprocessor/ifelse

Материал из C\C++ эксперт
Версия от 13:31, 25 мая 2010; Admin (обсуждение | вклад) (1 версия: Импорт контента...)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

ifelse

Use ifelse to define an action if the condition is not true.


<source lang="cpp">#define USA 1

  1. define EUP 1
  2. include <stdio.h>
  1. if (defined (USA))
       #define currency_rate 46
  1. else
       #define currency_rate 100           
  1. endif

main() {

   int rs;
   rs = 10 * currency_rate;   
   printf ("%d\n", rs);

}</source>

460