[advanced pointer application (Simulated Implementation of qsort sorting function)]
preface:
🐱 🏍 Ha ha, I'm very glad that you have entered my series of articles on pointer learning. I believe that in the process of learning pointer, most of your little partners must not be plain sailing. Once you learn it, you know that there may be a stagnation in one of these links. I think so as a Xiaobai, but no matter what, y ...
Posted by epimeth on Mon, 21 Feb 2022 15:14:22 +0100
The difference between const and define in C language
I const use
Const is the abbreviation of constant, which means "constant". The things modified by const are subject to mandatory protection, which can prevent accidental changes and improve the robustness of the program. So many C + + programming books suggest: "Use const whenever you need".
1.const modifier variable
#inc ...
Posted by skyer2000 on Mon, 21 Feb 2022 14:57:47 +0100
File IO operation
head.h
#ifndef _HEAD_H_
#define _HEAD_H_
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#endif
01_open.c
1.open int open(const ch ...
Posted by nasser on Mon, 21 Feb 2022 12:53:26 +0100
C/C + + development based on VSCode and Cmake -- environment construction and the first entry case
development environment
ubuntu subsystem under Windows Language c/c++ IDE:vscode
Environment construction
Open the windows subsystem option for Linux Control panel - > Programs - > enable or disable Window functions - > windows subsystem options for Linux
Download and install Ubantu In the Window10 version, open the app store and ...
Posted by beebum on Mon, 21 Feb 2022 10:20:21 +0100
Hello C -- pointers and functions
Pointers make a great contribution to the function of the function. Pointers can pass data to the function and allow the function to modify the data. The function of pointer to function mainly has two aspects: passing pointer to function and declaring function pointer.
1, Stack and heap of programs
The stack and heap of programs are the run ...
Posted by MrPotatoes on Mon, 21 Feb 2022 04:12:10 +0100
Hello C -- use of bit operation
ARM is the unified addressing of memory and IO. There are many control registers in SoC. These control registers are set by bit operation of these registers to control peripheral functions. During the process of modifying some bits of the register, other bits cannot be modified.
1, Basis of bit operation
The basic bitwise operators of C lan ...
Posted by hillbilly928 on Mon, 21 Feb 2022 04:11:22 +0100
Character array and string -- C language description
Character array and string -- C language description
1 character array
The character array is defined with the keyword char. The memory structure is sequential storage, as shown in Figure 1.1 below
char ch1[] = {'w', 'e'};
Figure 1.1 memory structure of character array
#include <stdio.h>
/*
Purpose:
1. Test character arr ...
Posted by gargoylemusic on Sun, 20 Feb 2022 15:27:40 +0100
C language game minesweeping [simple implementation]
preface
Mine sweeping game is to place a certain number of mines in a chessboard. Players can constantly eliminate mines to realize mine sweeping. If there is no mine nearby, they can eliminate a piece of chess pieces without mine nearby. If they encounter mine, the game will fail. If there is only mine left on the chessboard, mine clea ...
Posted by peterjoel on Sun, 20 Feb 2022 14:44:04 +0100
Algorithm - violence enumeration
Basic conditions of enumeration:
(1) time conditions:
The first is the time condition. Generally speaking, the mainstream OJ can run operations with operands less than 10 ^ 7 under the time limit of 1000ms (generally, it is safer to operate within 10 ^ 6). Therefore, it is best to look at the data range before adopting the enumeration method ...
Posted by levidyllan on Sun, 20 Feb 2022 14:28:39 +0100
About structure
1, Structure type declaration
C language has int,char and other keywords to declare data types. Similarly, a structure can also declare a structure type.
1. Definition, declaration and use:
(1) First kind
As follows:
struct example //Define a structure (keyword + structure name)
{
int a;
char b;
};
int main(void)
{
struct example S; ...
Posted by fingerprn on Sun, 20 Feb 2022 11:35:54 +0100