//
//MAIN.M
//struct
//
//Created by Mac on 14-12-2.
//Copyright (c)yearsmac. All rights reserved.
//
#import<Foundation/Foundation.h>
#pragma markBasic data Types----
voidBaseType ()
{
//unsigned Long%lu
Nsuinteger i;
//long
NsintegerJ;
//double
NstimeintervalK;
}
#pragmaStructural Body---------------
voidStructtype ()
{
//first Type
Nsrange range = { the, the};
NSLog(@ "%lu,%lu", range. Location, range.length);
//second Type
Nsrange Range1 = {. Location= +, .length= the};
NSLog(@ "%lu,%lu", Range1. Location, Range1.length);
//third Type
Nsrange Range3 = Nsmakerange(456,789);
NSLog(@ "%lu,%lu", Range3. Location, Range3.length);
//example
NSString *str =@ "Hello,nsstruct";
Nsrange range4 = [Strrangeofstring:@ "Hello"];
NSLog(@ "%lu,%lu", Range4. Location, Range4.length);
//point
NspointPoint = Nsmakepoint(0.0,0.0) ;
//size
nssizesize = nsmakesize(34.2,123.1);
//rect
Nsrectrect = Nsmakerect(0.0,0.0,234,231);
//CGthe beginning of the structure of the body
Cgpoint point1 = Cgpointmake(0.0,0.0);
cgsizesize1 = Cgsizemake(34.2,123.1);
CGRectRect2 = CGRectMake(45.2,34.2, +, -);
Cgpoint Point2 = Cgpointzero;
cgsizesize2 = Cgsizezero;
CGRectrect3 = Cgrectzero;
}
intMain (intargc, Const Char * argv[]) {
@autoreleasepool {
Structtype();
}
return 0;
}
"Foundation Frame" Struct