Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
book
//gcc 5.0.4 #import <Foundation/Foundation.h> @interface Book:NSObject { NSString *title; NSint *selingprice NSint *reprice } -(void)settitle:(NSString *)btitle; -(void)setselingprice:(int)bselingprice; -(void)setreprice:(int)breprice; -(void)getbookdetail; @end @implementation Book -(id) init { self=[super init]; title=@"abc"; selingprice=200; reprice=100; } -(void)settitle:(NSString *)btitle { title=btitle; } -(void)setselingprice:(int)bselingprice { selingprice=bselingprice; } -(void)setreprice:(int)breprice { reprice=breprice; } -(void)getbookdetail { NSLog(@"book \n title=%@ \nselingprice=%d \nreprice=%d",title,selingprice,reprice); } @end int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // NSLog (@"Hello, World!"); Book *b=[[Book alloc] init]; [b getbookdetail]; [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Az Flights Optimization
NSString Examples in one
NSMutableStringProgram
geomatric operations in objective c
Obj C Program Structure
Etudiant.h
Program 2.1
string compare
PRogram 3.2 - simple class
string type cast
Please log in to post a comment.