This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int number[10]; | |
/*populate the array*/ | |
number[0] = 10; | |
number[1] = 20; | |
number[2] = 30; | |
number[3] = 40; | |
number[4] = 50; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Try-Objective-C-by-Viet. | |
//|......................| | |
//"This is the hello world Objective C" | |
@interface Hello : NSObject | |
//the void to say | |
- (void) say; | |
@end | |
//The implementation to work the hello world object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "XYZPerson.h" | |
@implementation XYZPerson | |
- (void)sayHello { | |
NSLog(@"Hello, world!"); | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "XYZPerson.h" | |
@implementation nsstringifelse | |
NSString *sourceString = @"Four score and seven years ago"; | |
NSRange range = [sourceString rangeOfString:@"seven"]; | |
//NOTE NSRange IS NOT AN OBJECTIVE_C CLASS | |
if (range.location == NSNotFound) { | |
// Well the string was not found | |
} else { |