Static, extern and inline in Objective-C

前端 未结 2 984
刺人心
刺人心 2020-12-23 12:17

What do static, extern and inline (and their combinations) mean in Objetive-C using the LLVM compiler?

Also, I noticed that th

2条回答
  •  一向
    一向 (楼主)
    2020-12-23 12:19

    Justin covered most of it, but I found some other nice resources for those who want to dig deeper:

    By declaring a function inline you tell the compiler to replace the complete code of that function directly into the place from where it was called. This is a rather advanced feature that requires understanding of lower-level programming.

    Inline functions


    This SO question has an enormous answer about extern variables - variables defined "somewhere else" - but need to be used also "here".


    Static preserves variable life outside of scope. The Variable is visible within the scope it was declared.

    What does a static variable mean?


提交回复
热议问题