2013-12-30から1日間の記事一覧

#import <Foundation/Foundation.h> @interface myClass : NSObject { @public int age; int height; } @end @implementation myClass -(void) view : (int)key1 : (int)key2 { NSLog(@"person=[%d][%d]",age,height); NSLog(@"key1=[%d] key2=[%d]",key1,key2); } @end int main(int </foundation/foundation.h>…

#import <Foundation/Foundation.h> @interface myClass : NSObject { @public int age; int height; } @end @implementation myClass -(void) view { NSLog(@"person=[%d][%d]",age,height); } @end int main(int argc, const char * argv[]) { @autoreleasepool { myClass *personA </foundation/foundation.h>…

#import <Foundation/Foundation.h> @interface myClass : NSObject { @public int age; int height; } @end @implementation myClass @end void dispPerson(myClass *person){ NSLog(@"person=[%d][%d]",person->age,person->height); return; } int main(int argc, const char * arg</foundation/foundation.h>…

#import <Foundation/Foundation.h> @interface myClass : NSObject { @public int age; int height; } @end @implementation myClass @end int main(int argc, const char * argv[]) { @autoreleasepool { myClass *personA = [[myClass alloc] init]; myClass *personB = [[myClass </foundation/foundation.h>…

#import <Foundation/Foundation.h> enum Keys {AAA,BBB,CCC,DDD}; int main(int argc, const char * argv[]) { @autoreleasepool { NSLog(@"A=[%d]",AAA); //0 NSLog(@"B=[%d]",BBB); //1 NSLog(@"C=[%d]",CCC); //1 } return 0; }</foundation/foundation.h>

#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { for(int a=0;a<5;a++){ NSLog(@"Loop[%d]",a); } } return 0; }</foundation/foundation.h>

memo

#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { int a = 0; while(1){ if( a==2 ){ break; } NSLog(@"Loop[%d]",a++); } } return 0; }</foundation/foundation.h>

memo

#import <Foundation/Foundation.h> void unko(void){ NSLog(@"unko function!"); } int main(int argc, const char * argv[]) { @autoreleasepool { unko(); unko(); unko(); } return 0; }</foundation/foundation.h>

memo

#import <Foundation/Foundation.h> int HOGE = 10; int unko(int x, int y){ NSLog(@"hikisu=[%d][%d]",x,y); return x*y*HOGE; } int main(int argc, const char * argv[]) { @autoreleasepool { NSLog(@"return=[%d]",unko(5,2)); } return 0; }</foundation/foundation.h>

memo

#import <Foundation/Foundation.h> typedef struct BirthDate{ int year; int month; int day; } BirthDate; typedef struct Person{ int age; int height; BirthDate birth; } Person; void dispPerson(Person b){ NSLog(@"age=[%d]",b.age); NSLog(@"height=[%d]",b.height); NSLog</foundation/foundation.h>…