Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Author1
//gcc 5.0.4 #import <Foundation/Foundation.h> @interface Author : NSObject { NSString *authorName; NSString *authorEmail; char *authorGender; } - (id)initWithName:(NSString *)name andEmail:(NSString *)email andGender:(char *)gender; - (void)print; @end @implementation Author -(id)initWithName:(NSString *)name andEmail:(NSString *)email andGender:(char *)gender{ authorName = name; authorEmail = email; authorGender = gender; return self; } - (void)print{ NSLog(@"Name: %@", authorName); NSLog(@"Email: %@", authorEmail); NSLog(@"Gender: %c", authorGender); } @end int main(int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog(@"Base class Author Object"); Author *author =[[Author alloc]initWithName:@"aa" andEmail:@"ami" andGender:'f']; [author print]; [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
Uso de else if
Strings
abc
basic objective c
basic arithmatic Opreation in objective C
size of datatypes in objective c
simple inheritance in objective c
find maximum in objective c
objective c find factorial
asss