学习笔记 c语言第一课

程序由代码构成,程序是一组指令的集合,用于执行任务;代码是构建程序的原始语言指令。

c程序由函数组成,c语言库提供了一个丰富的现存函数集合,当你在使用c语言编程的时候,你会用到三种方式构建块:1.c语言标准库 2.自己创建 3.借用他人已创建的。

注释,用//开头或用/*……*/多行注释。

#include<stdio.h>,c语言是已经创造的东西,当我们使用的时候,就像向别人借东西一样,我们需要和别人打个招呼,而#include,stdio.h>就像是一种打招呼一样,表示我需要用到,告诉预处理器编程中含有<stdio.h>中的内容,如果漏写,计算机则会报错表示无法识别。stdio其中std为standard,标准,io为intput and output,h为header。

int为整形函数,return0表示返回到整数,两者相互呼应。

main函数被视为程序的入口,所有的程序都由main函数开始执行,但程序中main函数有且仅有一个,若有多个main函数,计算机会报错--main函数已有主体。

int main(),有些时候()会有void,强调其为空函数,void表示不再接受任何信息,有无void均可。

“{”作为函数的开头,“}”作为函数的结尾

printf,f 表示格式化,专门用来打印数据,printf ("qqqqq"),表示打印qqqqq,注意所需打印内容需用引号,他的参数在小括号和分毫内,称为语句;qqqqq为字符串。

结尾均用“;”表示本行的结束,每个语句必须用分号结尾。

\为转义符,\n表示转行,\t表示将光标移动到下一个制表位(在非文档当中,按列对其的下一行文本。)\\表示在字符串中插入符号\,\"表示在字符串中插入引号。

空行与留白可使计算机更好的识别程序,读取程序。

部分内容参考老师课件,为课程总结,若有错误,还望指出。

 597d42d4ea494b82aad8008f45321ab3.png

A program is composed of code, which is a set of instructions used to perform tasks; Code is the original language instructions used to build programs.
C programs are composed of functions, and the C language library provides a rich collection of existing functions. When programming in C language, you will use three ways to build blocks: 1. C language standard library 2. Create your own 3. Borrow others' created functions.
Comments, starting with//or using/*... */multi line comments.
#Including<stdio. h>, C language is something that has already been created. When we use it, it's like borrowing something from someone, and we need to say hello to them. # include, STDio. h>is like saying hello, indicating that I need to use it and telling the preprocessor that the programming contains content from<stdio. h>. If it is omitted, the computer will report an error indicating that it cannot recognize it. STDio, where std is standard, io is input and output, and h is header.
Int is a shaping function, and return0 represents returning to an integer, both of which correspond to each other.
The main function is regarded as the entry point of the program, and all programs start executing from the main function. However, there is only one main function in the program. If there are multiple main functions, the computer will report an error - the main function already has a body.
Int main(), sometimes there may be void in (), emphasizing that it is an empty function. Void means no longer accepting any information, and it can be used with or without void.

"{"begins a fuction,"}"end each fuctions.

printf,”f”stands for “formatted”.Its argument within the parentheses and semicolon,is called statement.

Every statement must end with a semicolon.

\is called an escape character,the escape sequence \n means a newline.\t means move the cursor to the next tab stop.\\ means inster a backslash character in a string .\”means inster a double-quote character in a string.

Blank line and white space make programs easier to read.

Part of the content is based on the teacher's courseware and serves as a summary of the course. If there are any errors, please kindly point them out.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值