Sign in to follow this  

struct declaration c/c++/obj-c

Recommended Posts

The first is C++ syntax. The latter is C syntax. obj-c is a superset of C, not C++. However, if you want XCode to compile the former, rename your file to .mm instead of .m

That will allow you to reference and use C++ code. Just remember when you start getting weird compile errors that any file that includes a header with C++ syntax must also have the .mm filename. When I'm starting a new iPhone project, the first thing I do is just rename everything to be .mm. That way I don't have to worry about it :)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this