Skip to content

c++ #define的好处是啥 #127

Description

@Draymonders

reference

https://bbs.csdn.net/topics/380157924

宏速度快~没有类型限制,缺点是不灵活,不知对否- -

优点:可完成函数调用的功能,又能减少系统开销,提高运行效率。因为它是在预处理阶段即进行了宏展开,在执行时不需要转换,即在当地执行。

缺点:所占用的目标代码空间相对较大

PS:牺牲空间来换取时间

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cppcpp相关,刷题遇到的新姿势

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions