Learning C language on the first day

Knowledge points:
Pre-class preparation
1: Blog:
1: Write your own blog, you can summarize what you have learned
2: Record your own learning process and experience, and give the interviewer more opportunities to learn about you
3: Willing to share your own experience

Two: What are the blog sites
1: CSDN
2: Blog network
3: 51CTO --- recommended
4: Open source China
5: Build your own (server + domain name; github blog)

Three: Use of Github
1: Register an account on github
2: Build a code warehouse--c-code
3: Upload the code written every day to the warehouse

Four: Tool
1: Evernote/Youdaoyun Note
2: x-mind --Mind Map

Five: How to learn c language well?
1: Always encourage yourself
2: Studying can’t complain and complain about no time . If you
want to wear the crown, you must bear it
. If you always walk the same way as others, how can you ensure that you surpass others, then you have to pay differently Effort
3: Refuse to reach out to the party-try to solve the problem by yourself
4: learn programming, not only must learn c language (school explanation content is less + shallow)
· learn c language = = learn programming
· learn c++/java/paython
· Learn data structure
, system and network (linux+system programming+network basic+network programming)

One: First acquaintance with c language
1: What is c language?

c language is a computer language

What is computer language? The language for human and computer communication c/c++/java/python

Language development:
low-level language:
binary language
hardware--electricity---positive electricity and negative electricity
1 0
1010101000111-------------Rely on manual to program
10101001----------- ----------Mnemonic--Assembly language
B language
high-level language
c language-----------------------Advanced

International standard: ANSI---c-89/c90

2: How to use vs2019
1: write c
1: create a new project ---- 2: create c++ 3: select an empty project 4: name (text-11-15)
5: select location

2: c code
1: click on the left-c-source file 2: right click 3: add 4: new item 5: select c++ file
6: name (text-c l)
3: write code

4: How to view the code?
1: Click the project name 2: Right-click 3: Properties 4: Configure properties --- Linker - System - Subsystem
5: Subsystem (▽) --> Click the inverted triangle --- Change to console
6: Application 7: OK

Run: ctrl+f--------fn+ctrl+f

//#include<stdio.h>
//int main() //int represents the meaning of rounding, main-main function-program entry-main function has and only one
//{
//printf("hello world\n"); //Complete the task here and output hello world on the screen
//printf--print function, \n---line feed, library function---c language itself provides us with functions
// return 0 ;//return 0
//}
//The int before main represents an integer value returned by the main function call
//void mian() ----This way of writing is outdated
//include #--Instruction type include - comprising
//<stdio.h>-- stdio.h contains a file, std-- standard (standard)
// I - iNPUT - input O - output - output

//Data type
//char--- character data type
//short-- short integer
//int---- integer
//long--- long integer
//long long-- longer integer
//float- --- single-precision floating-point number
//double--- double-precision floating-point number

//char---character type
//#include <stdio.h>
//int mian()
//{
//char ch='A';
// printf("%c\n", ch);/ /%c---Print data in character format
// return 0;
//}

//int ---整型
//#include <stdio.h>
//int main()
//{
//int age = 20;
//printf("%d\n", age);
//return 0;
//}

//long ---长整型
//#include <stdio.h>
//int main()
//{
//long num = 100;
//printf("%d\n", num);
//return 0;
//}

//float---single precision floating point
//#include<stdio.h>
//int main()
//{
//float f = 50;
//printf("%f\n", f);
//return 0;
//}

//double ---double floating point precision type
//#include<stdio.h>
//int main()
//{
//double d = 3.14;
//printf("%f\n", d); //f can replace Lf (uppercase L)---indicating double precision floating point
//return 0;
//}

//#include<stdio.h>
//int a = 100; global variables
//int main()
//{
//int = 10; local variables
//}
//global variables and local variables are recommended not to be the same and easy to misunderstand , Produce a bug
// When the local variable and the global variable have the same name, the local variable takes precedence

//Use of variables
//#include<stdio.h>
//int main()
//{
//Calculate the sum of two numbers
//int num1 = 0;
//int num2 = 0;
//int sum = 0;
//Input data--use the input function-scanf
//scanf("%d%d", &num1, &num2);//&--take the address symbol
//C language grammar stipulates that the variable should be defined in the current code The top of the block
//sum = num1 + num2;
//printf("sum = %d\n", sum);
//return 0;
//}

//The scope and life cycle of variables

//Scope: The name used in general program code is not always valid, and the code scope of the availability of this name is the scope of the name (where it can be used, where is the scope of diamante)

//The scope of local variables: the local scope where the variable is
//#include<stdio.h>
//int main()
//{
//int num = 0;
//printf("num = %d\n" , num);//The scope of num is inside this brace
//return 0;

//}

//Scope of global variables: the entire project
//#include<stdio.h>
//int global = 2020;
//int main()
//{
//printf("%d\n", global);
/ / return 0;
//}

//Example 1: Define a function
//#include<stdio.h>
//int global = 2020;
//
//void test()
//{
// printf("test()--%d\n" , global);
//}
//int main()
//{
// test();
// printf("%d\n", global);
// return 0;
//}

//Example 2
//#include<stdio.h>
//int main()
//{
// //undeclared identifier
// extern int g_val; //exxtern--declare external symbols
// printf( "g_val = %d\n", g_val);//g_val is in the file of sum.c
// return 0;
//}

//Life cycle-a period of time between the creation of a variable and its destruction
//1: The life cycle of a local variable: the life cycle of a local variable starts, and the life cycle of the initial scope ends
// 2: The life cycle of a global variable: The entire program life cycle

Guess you like

Origin blog.51cto.com/15005431/2551325