C language - selection structure
Select structure
The selection structure is used to judge the given conditions, judge some conditions according to the judgment results, and control the program flow according to the judgment results
1, If else statement
1. Single selection
Single selection can be realized through if statement. The syntax and execution process of i ...
Added by SheepWoolie on Mon, 17 Jan 2022 15:37:32 +0200
Format string learning
Common formatting string functions
Output:
functionBasic introductionprintfOutput to stdoutfprintfOutput to the specified FILE streamvprintfFormat the output to stdout according to the parameter listvfprintfFormat the output to the specified FILE stream according to the parameter listsprintfOutput to stringsnprintfOutputs the specified number ...
Added by bunner bob on Mon, 17 Jan 2022 14:28:27 +0200
Build your own utils Library in embedded Projects - Basic space-time cost calculation of different chips
Recently, I read the book "programming pearls", which focuses on the explanation of engineering treatment, which is well written. The most impressive example is the Brooklyn Bridge. Before the 1940s, many suspension bridges broke due to storms. To do the correct mathematical modeling and engineering calculation of this aerodynamic ris ...
Added by rickaclark on Mon, 17 Jan 2022 11:06:43 +0200
Bald diary-C-7
17, Byte alignment problem
1. What is byte alignment
The basic unit of memory size is bytes. When reading and writing memory, cup does not read it byte by byte, but reads and writes memory in bytes multiple of 2, 4 and 8; 32-bit data can be read in one read cycle from the even address, while the 32-bit data can be obtained by reading two cycl ...
Added by patch2112 on Sun, 16 Jan 2022 23:18:18 +0200
Develop a good habit of writing code
Good code style makes people look comfortable, easy to understand and have the desire to read.
Poor code style can be daunting
Lei Jun said that the code he once wrote was as beautiful as poetry
This article will introduce some points that are easy to be ignored when writing code
I Blank line
Blank lines serve to separate program ...
Added by spookztar on Sun, 16 Jan 2022 21:26:46 +0200
PGSQL protocol parsing and C/C + + code implementation
PostgreSQL uses message based protocols to communicate between the front end and the back end (client and server). T port number 5432 is registered with IANA as the preferred TCP port number of servers supporting this protocol, but actually any non privileged port number can be used.
What is PostgreSQL?
PostgreSQL, also known as Postgres, is ...
Added by podarum on Sun, 16 Jan 2022 17:47:02 +0200
202106C language level 2 true question
Digital amplification Given an integer sequence and magnification x, each integer in the sequence is amplified by x times and output.
Time limit: 1000 Memory limit: 65536 input It contains three lines: the first line N represents the length of the integer sequence (N ≤ 100); The second line is N integers (not exceeding the integer range), ...
Added by james19 on Sun, 16 Jan 2022 15:47:28 +0200
Branch and loop statements
1. Control statement
It is used to control the execution flow of the program to realize various structural modes of the program. They are composed of specific statement definer. C language has nine control statements.
It can be divided into the following three categories:
Conditional judgment statements are also called branch statements: if ...
Added by aouriques on Sun, 16 Jan 2022 13:57:11 +0200
Embedded C language knowledge summary
1 embedded C language summary
Grammatically speaking, C language is not complex, but it is not easy to write high-quality and reliable embedded C programs. It is not only necessary to be familiar with hardware characteristics and defects, but also need to have a certain understanding of compilation principle and computer technology knowledge ...
Added by The Saint on Sun, 16 Jan 2022 12:54:58 +0200
Various knowledge of C (small synthesis)
Tip: After the article is written, the catalog can be generated automatically, how to generate the help document to the right
Formatting Characters in C
%c:Single Character
%d:Decimal integer(int)
%ld:Decimal integer(long)
%f:decimal(float)
%lf:decimal(double)
%o:Octal Number
%s:Character string(char)
%u:Unsigned decimal n ...
Added by Pyro on Sun, 16 Jan 2022 08:36:36 +0200