,C米程序设计语言 as/The C Programming Language #黑日工作室 常感谢天津城市建 没学院周锦姝老师
#黑日工作室# 非常感谢 天津城市建 设学院周锦姝老师
教材、参考书与课时安排 教材 C程序设计谭浩强编著清华大学出版社 参考书 The C programming language (美) Brian wKernighan Dennis m. ritchie著 C语言教程(英文版)AB0 ok On c (美) Al Kelley Ira pohl著机械工业出版社 课时安排 授课:28学时 C综合编程训练:28学时 上机安排 上机地点:计算机系机房(12楼)
教材、参考书与课时安排 – 教材 C程序设计 谭浩强编著 清华大学出版社 – 参考书 The C Programming Language (美)Brian W.Kernighan Dennis M.Ritchie 著 C语言教程(英文版) A Book On C (美)Al Kelley Ira Pohl 著 机械工业出版社 – 课时安排 授课 :28学时 C综合编程训练:28学时 – 上机安排 上机地点:计算机系机房(12楼)
课程要求 课前请做好预习 保持课堂安静,头脑清醒,思维活跃,积极发言 认真、独立、按时完成并提交作业,作业必须经上 机调试通过 重视上机实践,有效利用宝贵的上机时间,发现上 机时间上网,按缺席一次处理 分值安排考试成绩70%平时成绩30%
课程要求 ▪课前请做好预习 ▪保持课堂安静,头脑清醒,思维活跃,积极发言 ▪认真、独立、按时完成并提交作业,作业必须经上 机调试通过 ▪重视上机实践,有效利用宝贵的上机时间,发现上 机时间上网,按缺席一次处理 ▪分值安排 考试成绩 70% 平时成绩 30%
1 The C Programming Language Chapter 1 An Overview of C Chapter 1 An overview of c The history of C The feature of c VBS ◆◆◆ The pattern of ac program Running a c program
Chapter 1 An Overview of C The history of C The feature of C The pattern of a C program Running a C program The C Programming Language Chapter 1 An Overview of C
1 The C Programming Language Chapter 1 An Overview of C 1.2 The feature of C C is terse, it has fewer keywords C has a lot of operators and data types c is structured and modular C is the basis for C++ and java VBS C is portable Code written on one machine can be easily moved to another
1.2 The feature of C – C is terse , it has fewer keywords –C has a lot of operators and data types – C is structured and modular. – C is the basis for C++ and Java – C is portable.Code written on one machine can be easily moved to another. > > > > The C Programming Language Chapter 1 An Overview of C
1 The C Programming language Chapter 1 An Overview of C 32 keywords:(由系统定义,不能重作其它定义) auto break case char const continue default do double else enum extern float for goto if int long register return 682 short signed sizeof static struct switch typedef unsigned union void volatile while
32 keywords :(由系统定义,不能重作其它定义) auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef unsigned union void volatile while < The C Programming Language Chapter 1 An Overview of C
1 The C Programming language Chapter 1 An Overview of C statements(语句): Labeled statements( Expression statements( Compound statements( Selection statements( if (expression) statement if (expression) statement else statement switch (expression) statement VBS Iteration while(expression) statement do while(expression) for(expl; exp2: exp3) statement Jump statements( continue, break goto identifier return expression
statements(语句): Labeled statements(带标号语句) Expression statements(表达式语句) Compound statements(复合语句) Selection statements(选择语句) if (expression) statement if (expression) statement else statement switch (expression) statement Iteration while (expression) statement do while (expression) for (exp1;exp2;exp3) statement Jump statements(跳转语句) continue; break; goto identifier; < return expression; The C Programming Language Chapter 1 An Overview of C
The C Programming language Chapter 1 An Overview of C 34 operators(运算待) Arithmetic(算术) operators:+ ‰++ Relational(关系) operators: & Assighment(赋值) operators:= Conditiona1(条件) operators:?: 冷coma逗号) operators: Address(地址) operators k& Sizeof(求字节数) operators: sizeof Casts(强制类型转换):( type-name) Structure member(分量) operators:.- Subscript(下标) operators:[] others
34 operators(运算符): Arithmetic(算术) operators:+ - * / % ++ -- Relational(关系) operators : >= != Logical(逻辑) operators :! && || Bitwise(位) operators :> ~ | ^ & Assighment(赋值) operators : = += -= Conditional(条件) operators : ? : Comma(逗号) operators : , Address(地址) operators :* & Sizeof (求字节数) operators: sizeof Casts(强制类型转换):(type-name) Structure member(分量) operators : . -> Subscript(下标) operators :[ ] others :( ) - < The C Programming Language Chapter 1 An Overview of C
1 The C Programming Language Chapter 1 An Overview of C short int Integer int Arithmetic long int types Basic single precision floating point float floating types double precision floating point double Character types char arrays Data structures Types Constructed unIons types enum pe inters void <)定义类型 typedef
Data Types Constructed types pointers void 定义类型 typedef Character types char enum integer floating single precision floating point float double precision floating point double short int long int int arrays structures unions < The C Programming Language Chapter 1 An Overview of C Basic types Arithmetic types
The C Programming language Chapter 1 An Overview of C 1.3 The pattern of a C program Exampl 1. 1 the first c program Hello, World! /example1. 1 The first C Program*/ notation include Include information about standard library main( define a function named main ev)printf("Hello,World!");← statement output: Hello world
1.3 The pattern of a C program Exampl 1.1 the first c program Hello,World! /* example1.1 The first C Program*/ #include main() { printf(“Hello,World!”); } > notation Include information about standard library define a function named main statement output: Hello,World! The C Programming Language Chapter 1 An Overview of C