Re: Objective-C or C++ or something...
Re: Objective-C or C++ or something...
- Subject: Re: Objective-C or C++ or something...
- From: Óscar Morales Vivó <email@hidden>
- Date: Thu, 7 Aug 2003 23:10:52 +0200
On Thursday, 7 August 2003, at 22:25 PM, Karl Kuehn wrote:
Strict C and C++ do not allow this, ObjC and ObjC++ do allow this, so
all you have to do is change file extension over and you will be
golden. You don't have to use anything in the Obj side of the
language. C++ files named as ObjC++ files will compile just fine
(there may be something in the more advanced structures where I am
wrong... but for most of us...).
Uh, sorry to be picky, but the C++ standard AFAIK sure tells you can
declare variables nearly anywhere.
Anyway, if you want to use some C++-isms in your code (like references,
sometimes useful) just use the .mm suffix for all code files that use
them (including those that import headers with C++-isms.
However, if you use GCC 3.x you'll probably be able to use most of C99,
including declaring variables anywhere.
Hope that helps.
/*
Oscar Morales Vivs
Eternal Computer Science Student. Master of C++ Templates. Cocoa Nut.
Computer Graphics Scientiam Lumina. UI Guru in Training. Dabbler in all
things CS and most which are not.
Web stuff:
http://homepage.mac.com/oscarmv/index.html
*/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.