064.#If #else 与if else的区别
来源:互联网 发布:淘宝实名认证人脸识别 编辑:程序博客网 时间:2024/06/04 19:50
--------------- main.m ---------------
#import<Foundation/Foundation.h>
#define AGE25
intmain()
{
#if AGE >60
NSLog(@"老年人");
#elif AGE >40
NSLog(@"中年人");
#elif AGE >20
NSLog(@"青年人");
#else
NSLog(@"少年人");
#endif
intmain()
{
#if AGE >60
NSLog(@"老年人");
#elif AGE >40
NSLog(@"中年人");
#elif AGE >20
NSLog(@"青年人");
#else
NSLog(@"少年人");
#endif
}
一、编写本节代码的具体步骤:
1.参照003节的代码编写步骤。
二、本节代码涉及到的知识点:
1.#If #else 与if else相比,前者属于编译之前的预处理,不符合条件的话,根本不会参与编译。
2.而if else等语句,全部会编译成执行性代码,然后再根据条件决定执行哪些代码。
0 0
- 064.#If #else 与if else的区别
- 064.#If #else 与if else的区别
- if...else if与if的区别
- if与else if的区别
- if与if-else的区别
- if......if和if......else if......else if的区别
- if else if与if if语句的区别
- if...if与if...else if的区别
- else if 与else
- 简述if if和else if的关系与区别
- if else 与 switch case的区别:
- switch与if..else区别
- if else与switch区别
- if...if 和if...else if...的区别
- if, else if, else
- if else if else
- if (){}else if(){} else{}
- if if 与if else if 引发的错误
- 使用JavaScript定时刷新,请求响应时间慢慢变长
- 061.Arg Define 宏的更严谨的写法
- mac命令行安装homebrew
- 062.#IfDef 使用宏来进行条件编译
- 063.#IfDef 使用宏来控制调试信息
- 064.#If #else 与if else的区别
- Git学习
- 065.Pointer 什么是指针
- UVA490注意字符串后面内容,不要想当然
- AndroidStudio快捷键汇总
- 本人博客已迁移
- 066.Pointer 使用指针替换一个变量的值
- 067.Pointer 使用指针交换两个变量的值
- wyh2000 and a string problem(bc题)