views:

104

answers:

2

We're going to have to write a C library and this library has to be accessible from Objective-C. Now I don't know anything about Objective-C so I wonder how simple Objective-C <-> C interoperability is. Is that as simple as including the C header in the Objective-C code and linking to the library? Is there anything special I'm supposed to do (like the extern "C" bit with C++)?

+11  A: 

Objective-C is a strict superset of C. You don't need to use extern "C" or anything like that.

Mehrdad Afshari
We wrote almost the exact sentence but you beat me. :)
BobbyShaftoe
+5  A: 

Objective-C is a strict superset of GNU C (note, this is not the same as ISO C90).

BobbyShaftoe
Using the `gcc` compiler, it's a strict superset of whatever standard happens to be in effect (via `-std=...`). Though it should be noted that there is no official `Objective-C Standard`, so it's really what ever the compiler you're using happens to compile. :)
johne