Primary minesweeping (C language version)
This blog mainly talks about a simple version of mine sweeping.
catalogue
1. Overall design of mine clearance project
2. Function module implementation in game function
2.1 initialize the chessboard module—— void InitBoard(char board[ROWS][COLS], int row, int col, char ret);
2.2 display chessboard function—&mdash ...
Posted by Thora_Fan on Tue, 21 Sep 2021 10:25:17 +0200
c + + knowledge points (constantly updated)
const
class A {
private:
const int a;//Constant object members can be initialized using the initialization list or in class
public:
//Constructor
A() :a(0) {};
A(int x) :a(x) {};//Initialization list
//const can be used to distinguish overloaded functions
int getValue();//Ordinary member function
int getValue() const;//A constant membe ...
Posted by mpharo on Tue, 21 Sep 2021 09:44:36 +0200
C Language Learning
C Language Learning
day1
1. Some piecemeal points of knowledge:
Run environment VC++ 2010, remember to modify fonts and add commands "Run (but not debug)", display line numbers, etc.
You need to modify the main code file suffix to'.c'after creating the project
How does it work after writing the code?
C Required after writin ...
Posted by Jabop on Tue, 21 Sep 2021 08:35:36 +0200
Talk about the use and attention of common string functions in C language (strlen,strcpy,strcmp,strcat)
preface
String functions in c language are difficult to maintain and use. It is often necessary to consider whether they cross the boundary and the position of 0. Sometimes, when some compilers use string functions in c language, the compiler will warn you ⚠ Prompt that the function is unsafe;
Even many object-oriented languages, such as Java ...
Posted by greenie__ on Tue, 21 Sep 2021 06:20:18 +0200
Force Button Exercise 1 (Ten Questions)
1. Given an integer array nums and an integer scalar target, find the two integers in the array that are the target and return their array subscripts.
You can assume that each input corresponds to only one answer. However, the same element in the array cannot be repeated in the answer.
You can return the answers in any order.
Example 1:
...
Posted by emopoops on Tue, 21 Sep 2021 02:54:11 +0200
C language data structure - single linked list
Concept of linked list
Concept: linked list is a non continuous and non sequential storage structure in physical storage structure. The logical order of data elements is realized through the pointer link order in the linked list. Let's start the single linked list Create a structure first
typedef int SLTDateType;
typedef struct SListNode ...
Posted by jgetner on Mon, 20 Sep 2021 08:18:05 +0200
C language - string function, memory function notes
Sort out the commonly used library functions for processing characters and strings, as well as the usage, precautions and partial simulation implementation of memory functions
strlen
This function receives a char * type parameter and returns the number of characters before string \ 0. Note that the return type is size_t-shaped
//An error p ...
Posted by mostwantedunm on Mon, 20 Sep 2021 02:01:15 +0200
STL learning notes string
STL learning notes (I) string
c_str()
const char *c_str();
c_ The str() function returns a pointer to the normal C string, with the same content as this string
string s="123"
printf("%s",s.c_str())
Add: insert()
iterator insert( iterator i, const char &ch );
basic_string &insert( size_type index, const basic_string & ...
Posted by derrick24 on Sun, 19 Sep 2021 20:41:52 +0200
Detailed explanation of C language operators (learn C series with bug Guo)
Operators and expressions
We are Initial C language Now that we have a general understanding of operators, let's dissect operators in detail today.
Operator
There are many operators in C language, but after roughly classifying, there are the following operators
//Arithmetic operator
+ - * / %
//Shift operators
<< >>
// ...
Posted by kfresh on Sat, 18 Sep 2021 21:19:49 +0200
Introduction and Simulation Implementation of string function
There are many functions in the C language library, among which the string function is a commonly used one, which needs us to master.
catalogue
1. strlen (find string length)
1.1 strlen Simulation Implementation
2. strcpy (copy string)
2.1 strncpy function
2.2 simulation implementation strcpy
3. strcat (additional characters)
3.1 st ...
Posted by itsureboy on Sat, 18 Sep 2021 10:21:50 +0200