Snake game (c + + implementation)
It is recommended to copy the code and run it again to see the idea!!!
Easy to understand, please read it carefully.
It is worth noting that the code I give does not add walls. If necessary, add it yourself.
No difficulty design, ibid.
Map size (the wall is designed here, which is not implemented in the code)
Set an intege ...
Added by kungfu71186 on Sat, 18 Dec 2021 18:12:45 +0200
Advanced use of embedded C language (the most detailed in the whole network)
Advanced use of embedded C language (the most detailed in the whole network)
1, Macro
Macro, in my opinion, is a major feature of C language. On this basis, some special functions can be used.
1.1 variable type parameter macro
In some application scenarios, we often need to find the maximum and minimum values similar to the two. We often ...
Added by kippy on Sat, 18 Dec 2021 17:12:31 +0200
Computer experiment of data structure (Chapter 6) - tree and binary tree I
1. Establish the chain storage structure of binary tree (bracket representation)
Algorithm idea: ① If ch = '(': it means that the node p just created has child nodes, and it needs to be stacked as the top node of the stack in order to establish the relationship between it and its child nodes (if a node has just been created, and the subsequ ...
Added by dotwebbie on Sat, 18 Dec 2021 12:28:04 +0200
[solution] [AcWing] 1601. Online map
1601. Online map
Original question transmission: AcWing 1601. Online map
Enter our current location and destination, and the online map can recommend some routes.
Now your job is to recommend two routes to users: one is the shortest route and the other is the fastest route.
Ensure that there is at least one route between the two places for ...
Added by jlp09550 on Sat, 18 Dec 2021 11:40:20 +0200
C language essay 01 --- how to understand conditional compilation
Architecture diagram
preface
Due to the regional translation relationship, some books translate macro into "macro" and some into "macro". In order to avoid confusion (myself), the English name macro will replace the Chinese name
What is conditional compilation
Conditional compilation is a statement that makes selective ...
Added by webpals on Sat, 18 Dec 2021 03:29:24 +0200
C language - linked list (one-way linked list, two-way linked list)
1. Introduction to linked list structure
We have learned the use of arrays in the previous chapters. The space of arrays is continuous and the size of arrays is constant. In many application scenarios of dynamic data storage, it is inconvenient to use; The linked list structure introduced in this article supports the dynamic addition and relea ...
Added by peddel on Fri, 17 Dec 2021 20:23:42 +0200
Array pointer and pointer array
Array pointer
before unveiling the magic of array pointers, let's explore whether arrays have their own specific types?
1. Array type
we know that an array is an ordered collection of variables of the same type. For example, int a[5] = {0};, The meaning is that five int variables are collected together and managed by arr ...
Added by hebisr on Thu, 16 Dec 2021 22:23:18 +0200
Hand torn advanced C language --- pointer (full of dry goods! Worth collecting!!)
We have already touched the topic of pointer in the chapter of pointer at the primary stage. We know the concept of pointer:
A pointer is a variable used to store an address, which uniquely identifies a piece of memory space.The size of the pointer is fixed at 4 / 8 bytes (32-bit platform / 64 bit platform).Pointers are typed. The pointer typ ...
Added by melissal on Thu, 16 Dec 2021 16:56:17 +0200
How to use the process? What is the difference between and thread usage?
How to use the process? What is the difference between and thread usage?
When doing network IO programming, a very ideal situation is to allocate a thread to the new client every time accept returns. Such a client corresponds to a thread. There will be no multiple threads sharing a sockfd. Per request per thread, and the code logic is very rea ...
Added by kazer on Thu, 16 Dec 2021 13:54:08 +0200
Remote video control series - mjpg stream source code analysis - init_v4l2
Entry parameter: struct vdIn * vd.
1. Turn on a usb camera
if((vd->fd = OPEN_VIDEO(vd->videodevice, O_RDWR)) == -1) {
perror("ERROR opening V4L interface");
DBG("errno: %d", errno);
return -1;
}
#define OPEN_VIDEO(fd, flags) open(fd, flags)
The main function is the open function, where VD - > videodevice ...
Added by jamiel on Thu, 16 Dec 2021 07:46:58 +0200