C Tutorial/Preprocessor/ifelse — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 13:31, 25 мая 2010
ifelse
Use ifelse to define an action if the condition is not true.
<source lang="cpp">#define USA 1
- define EUP 1
- include <stdio.h>
- if (defined (USA))
#define currency_rate 46
- else
#define currency_rate 100
- endif
main() {
int rs; rs = 10 * currency_rate; printf ("%d\n", rs);
}</source>
460