Re: Simple question
Re: Simple question
- Subject: Re: Simple question
- From: Scott Thompson <email@hidden>
- Date: Mon, 17 Mar 2008 08:33:31 -0500
On Mar 17, 2008, at 7:53 AM, Luca Ciciriello wrote:
Yes, you got it. .h stands for "header" and is the place where you
make your declarations, .m stands for "module" and is where the
definitions take place.
You can encounter also .mm exetension. In these file you can mix
Objective-C an C++ language.
I would recommend that you find a nice book on C. I would recommend
one, but it's been a while since I've surveyed the literature.
The C derived languages (with those most relevant to Macintosh
programming being, C, C++, Objective-C, and Objective-C++) tend to
separate your code into two parts. The first is the active part of
your program, that part which "does things". This code is placed into
a file whose extension depends on the language you are using. As Luca
points out ".c" is for C source code. ".m" is for Objective-C source
code. C++ source is usually found in a file ending either in ".cp" or
".cpp". And Objective-C++ code uses ".mm".
The header, or ".h" file doesn't typically contain active code.
Instead, it usually contains some kind of description of the code that
is found in the corresponding source code file. The description lets
other part of your program know what functionality can be found in the
source code file.
To sum up, the source code file defines what your program can do, and
how it can do it. The header file declares what's available and you
you invoke it.
Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden