- 博客(18)
- 收藏
- 关注
原创 OC-------------------LessonClassAndObject
main.m#import "Person.h"#import "Car.h"#import /** * 面向过程:以过程为核心,注重完成事件的详细步骤,一步一步如何实现. 面向对象:以实物为核心,注重的是参与该事件的事物应该具备的功能.而完成该事件只是事物所有功能中的一个功能. OO:(Object Oriented)面向对象 OO
2014-12-19 22:34:07 194
原创 C---------------------总结
一.基本数据类型,变量,常量,运算符1.数据类型.int,short,char,long,float,double.2.常量的分类.(1).整型常量(2).浮点型常量(3).字符型常量(4).字符串常量3.常量的特性.常量存储在常量区,常量区的内容不可被更改.4.变量的定义与本质:数据类型 变量名 = 初值. 本质变量激素hi一个容器.5.变量名的命名规范:数字,字母和下划
2014-12-18 18:58:56 200
原创 C-------------------LessonEnum
//以#开头的叫做预编译指令.//预编译阶段做一些文本以及代码的替换工作.#import //#import "" 导入自定义的头文件//#import > 导入系统定义的头文件//面试题:#include 与 #import 的区别.//#import 相比 #include 能够防止重复导入, 引起交叉编译.//变量名
2014-12-18 18:55:32 175
原创 C----------------LessonDynamicSort
#import typedef struct student { char name[10]; int age; float score;}Student;typedef BOOL (*SORT) (Student,Student);struct nameFunctionPair{ char name[10]; //名字 S
2014-12-17 21:34:18 182
原创 C---------------LessonDynamicMemory
#import //定义宏:三部分: 1.#define 2.宏名 3.替换的内容//宏的作用: 只做替换.//宏名的命名规范:1.全部大写. 2.k + 驼峰(kNumberArray)//无参宏#define NUMBER 6//有参宏//宏应该注意的几个问题://1.宏名大写.//2.参数一定要加小括号.//3.宏替换的内容不要加分号.//4.对于
2014-12-17 21:32:50 200
原创 C----------------LessonPointerHigher
#import //交换 两个数的值void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp;}//p --- 接收数组的首地址//count --- 接收数组的元素个数//1.给数组元素赋值void assignArr(int *p,const int count
2014-12-17 21:31:50 167
原创 C-----------------LessonPointerHigher
#import //交换 两个数的值void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp;}//p --- 接收数组的首地址//count --- 接收数组的元素个数//1.给数组元素赋值void assignArr(int *p,const int count
2014-12-17 21:28:09 153
原创 C-----------------LessionPointer
#import int main(int argc, const char * argv[]){ /* //访问数据的方式,1.直接访问,直接访问变量.2.间接访问,找到变量的地址. int a = 10; printf("%d\n", a); //指针变量,专门用来存储地址的变量. //int * :指针变量的类型;
2014-12-17 21:26:13 190
原创 C-----------------LessonRecursion
#import #import "Recursion.h"typedef struct student{ char name[10]; int age; float score;}Student;//输出单个学生信息void outputStudentInfo(Student stu){ printf("%s %d %.2f\n"
2014-12-17 21:23:45 148
原创 C-----------------LessonScale
#import int main(int argc, const char * argv[]){ /** * 十进制: 10 二进制: 0b10 八进制: 010 十六进制: 0x10 */// 100 001 000 000 -----
2014-12-17 21:20:45 162
原创 C------------------LessonStruct
#import //定义结构体struct student { //结构体成员 char name[10]; //存储姓名 int age; //存储年龄 float score; //存储成绩};//分号是结构体定义的结束标志,必不可少.//给学生结构体类型重新起一个名字typedef struct stud
2014-12-17 21:17:44 174
原创 C---------------LessonFunctionTwo
#import #import "Function.h"//导入头文件,本质就是将.h文件中内容全部拷贝到该文件中.int test(int n){ static int sum =0; sum += n; return sum;}int main(int argc, const char * argv[]){ int v
2014-12-17 21:12:25 143
原创 C-----------------LessonFunction
#import /** * 函数定义: 返回值类型 函数名(形参列表) {函数体(函数的实现内容)} *///函数定义第一种形式: 无参数,无返回值.//即使没有参数,小括号也必不可少.(warning)void buyMilk(){ printf("Nothing\n");}//函数名的命名规范:由多个英文单词组成,除了第一个单词的首字母小写,其余
2014-12-17 21:08:42 179
原创 C----------------LessonArrayHigher
#import int main(int argc, const char * argv[]){ /* //二维数组 int a[3][4] = {1, 2, 3, 4, 5 ,6, 7, 8, 9, 10, 11, 12}; //通过双下标访问二维数组中的元素,先访问到行,再访问到列. printf("%d\n", a[2][
2014-12-17 21:06:05 154
原创 C----------------LessonArray
#import int main(int argc, const char * argv[]){ //1.定义100个整型变量.// int a = 0, b = 0; //数组: 快速定义多个变量(容器). //数组定义: 数据类型 数组名[数组元素的个数] = {值1, 值2, 值3, ...}; //数组所占存储空间大小
2014-12-17 21:01:22 163
原创 C---------------LessonCircle
#import int main(int argc, const char * argv[]){ //initialization: 循环变量初始化,记录循环初始值. //condition: 循环条件,条件满足执行循环体. //increment: 循环变量增量. //statements: 循环体,反复执行的代码. /*
2014-12-17 20:59:04 172
原创 C----------LessonCondition
#import int main(int argc, const char * argv[]){ /* char c = 0; printf("请输入一个字符:\n"); scanf("%c", &c); printf("c = %d\n", c); */ /* int a = 0; p
2014-12-17 20:54:10 198
原创 C----LessonDataType
#import int main(int argc, const char * argv[]){ //变量定义:数据类型 变量名 = 初值 //变量名的命名规范: //1.只能由数字,字母,下划线组成,但是数字不能开头. //2.不能和系统关键字重名. //3.变量名要具有自解释性(见名知意). //4.变
2014-12-17 20:44:58 240
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人