Just see the seventh chapter first.
Basic data types, assignment statements
For loop, while loop, do While loop
Branch judgment, if statement, IfElse statement, switch statement
//
Main.m
Myoc
//
Created by DBJ on 2015/11/15.
Copyright? 2015 DBJ. All rights reserved.
Clang-fobjc-arc-framework Foundation Main.m-o Myoc
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
@autoreleasepool {
Insert code here ...
NSLog (@ "Hello, world! test");
NSLog (@ "sizeof (char) =%lu¥n", sizeof (char));
NSLog (@ "sizeof (short) =%lu¥n", sizeof (short));
NSLog (@ "sizeof (int) =%lu¥n", sizeof (int));
NSLog (@ "sizeof (long) =%lu¥n", sizeof (long));
NSLog (@ "sizeof (float) =%lu¥n", sizeof (float));
NSLog (@ "sizeof (double) =%lu¥n", sizeof (double));
int i = 0;
for (int i = 0; i < ++i) {
NSLog (@ "i=%i", I);
}
/*int a = 0;
scanf ("%i", &a);
NSLog (@ "i=%i", a); */
while (i > 0) {
I--;
NSLog (@ "i=%i", I);
}
}
return 0;
}
Objective-c (1)