Hi every one here
I am glad to be here I and to found like these forum

,,,
I start to learn objective-c ..
but in beginning I can'nt realize some thing ..
exactly in these program
1- in c program we write the function after main function , just we delectation it before main , is [BOOL areIntsDifferent (int thing1, int thing2)]
function , it does mean we can write it before main .
2- [NSString *boolString (BOOL yesNo)] , what does it mean the star * before [*boolString] also here [int main (int argc, const char *argv[])]
3- in main .. [ BOOL areTheyDifferent; ]
is these a delectation of variable it's type BOOL {yes,NO}
and it's name is areTheyDifferent ,,, or what ? and what it do in the main (what is benefit here in the main )
sorry for my questions
thank u at all , good luck
I am glad to be here I and to found like these forum
,,,
I start to learn objective-c ..
but in beginning I can'nt realize some thing ..
exactly in these program
PHP:
#import <Foundation/Foundation.h>
// returns NO if the two integers have the same
// value, YES otherwise
BOOL areIntsDifferent (int thing1, int thing2)
{
if (thing1 == thing2) {
return (NO);
} else {
return (YES);
}
} // areIntsDifferent
// given a YES value, return the human- readable
// string "YES". Otherwise return "NO"
NSString *boolString (BOOL yesNo)
{
if (yesNo == NO) {
return (@"NO");
} else {
return (@"YES");
}
} // boolString
int main (int argc, const char *argv[])
{
BOOL areTheyDifferent;
areTheyDifferent = areIntsDifferent (5, 5);
NSLog (@"are %d and %d different? %@",
5, 5, boolString(areTheyDifferent));
areTheyDifferent = areIntsDifferent (23, 42);
NSLog (@"are %d and %d different? %@",
23, 42, boolString(areTheyDifferent));
return (0);
} // main
1- in c program we write the function after main function , just we delectation it before main , is [BOOL areIntsDifferent (int thing1, int thing2)]
function , it does mean we can write it before main .
2- [NSString *boolString (BOOL yesNo)] , what does it mean the star * before [*boolString] also here [int main (int argc, const char *argv[])]
3- in main .. [ BOOL areTheyDifferent; ]
is these a delectation of variable it's type BOOL {yes,NO}
and it's name is areTheyDifferent ,,, or what ? and what it do in the main (what is benefit here in the main )
sorry for my questions
thank u at all , good luck