C code in Object-C?
C code in Object-C?
- Subject: C code in Object-C?
- From: Hisaoki Nishida <email@hidden>
- Date: Sun, 8 Jul 2001 18:26:18 -0400
I am working my way through the Learning Cocoa book, and encountered a
code example that mixes C code in Object-C. All the other code so far
has been Object-C syntax, but suddenly I see C code out of no where. I
don't understand why the writer decided to do this. I don't see the need
to use C code instead of Object-C here, unless the writer decided to
just show it's possible to mix code. It's just confusing. I don't even
know why standard C code would work with the compiler?
I'd appreciate any clarification regarding this matter.
Anyway, here's the example code at page 245:
//
Declare time-conversion functions
These functions provide computational services to clients of this class,
converting time in seconds to hours and minutes (as required by the user
interface) and back again to seconds (as stored by ToDoItem):
long ConvertTimeToSeconds(int hour, int minute, BOOL pm);
BOOL ConvertSecondsToTime(long secs, int *hour, int *minute);
//
Thanks for your help,
Hisaoki N.