iOS从零基础到精通就业-C语言入门
(学习路径http://blog.youkuaiyun.com/lanouluanbin/article/details/53518018)
1 变量的定义
//
// main.m
// 变量的定义
//
// Created by 蓝鸥 on 16/7/21.
// Copyright © 2016年 luanbin. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
//变量的定义
//语法
//变量的类型 变量的名字 = 初值值;
int age = 18;
char sex = 'm';
sex = 'f';
/*
规范
1,名字只能有数字,字母,下划线,美元符号构成,并且不能以数字开头
2,见名知意
3,驼峰命名法
4,先定义后使用
5,变量不能重名
*/
int a1 = 10;
int b1 = 20;
float studentScore = 99.5;
studentScore = 89.5;
studentScore= 79.5;
//teacherScore = 999.5;
//float studentScore = 66.6;
return 0;
}