Is objective C 2.0 a proper superset of C?

后端 未结 2 430
无人共我
无人共我 2020-12-07 02:42

I\'ve heard that objective-C is a proper superset of C, but is objective-C 2.0?

The reason I ask is that either it isn\'t, or I misunderstand the phrase \'proper sup

2条回答
  •  生来不讨喜
    2020-12-07 03:03

    Objective-C a proper superset of C, as everything that works in C will work with Objective-C.

    BUT,

    as it is a superset, it adds some new types, definitions and directives.

    That means that if you use a reserved definition like nil, you are getting into serious trouble.

    That's why the above program does not compile.

提交回复
热议问题