C + + classes and objects
1, Class Constructor: the constructor is a special member function with the same name as the class name. It is automatically called by the compiler when creating a class type object to ensure that each data member has an appropriate initial value and is called only once in the life cycle of the object. Characteristics of constructors: construct ...
Posted by siobhan on Tue, 23 Nov 2021 00:53:15 -0800
Branch and loop statements of C Forum
Hello, everyone. Today I'll take you to know the loop and branch statements in C language (compiler: VS2019)
-------------
1, What is a sentence?
C statements can be divided into the following five categories:
Expression statementFunction call statementControl statementCompound statementEmpty statement
What the blogger will sha ...
Posted by datoshway on Mon, 22 Nov 2021 22:15:35 -0800
C language minesweeping games
This article will use C language to realize a simple minesweeping game. (the full code is at the end of the article)
① Test logic of the game (its code is stored in test.c);
② The implementation logic of the game (its code is stored in game.c);
③ Declaration of game implementation functions (the declaration of each function is stored in game ...
Posted by canabatz on Mon, 22 Nov 2021 14:13:41 -0800
Chapter IV summary of C language
#include<stdio.h> #include<math.h> int main() { int a, b, c; float area; double s; printf("please enter three sides of the triangle:"); scanf_s("%d,%d,%d", &a, &b, &c); s = (a + b + c) / 2.0; if (a + b <= c || b + c <= a || a + c <= b) printf("does not form a triangle \ n&q ...
Posted by carlos1234 on Mon, 22 Nov 2021 02:45:27 -0800
Linux: process replication (fork)
Copy process fork method
Basic concepts
First, let's look at the fork method: create a child process. The process calling fork function is the parent process, and the newly generated process is the child process.
The format is:
pid_t fork(void);
Return the pid of the child process in the parent process, 0 in the child process, and - ...
Posted by cornelalexa on Sun, 21 Nov 2021 18:22:12 -0800
TCP/IP Network Programming Notes
Chapter 1 understanding network programming and sockets
1.1 understand network programming and sockets
1.1.1 network programming and socket overview
Network programming: write programs to enable two networked computers to exchange data with each other.
socket: a software device used for network data transmission.
Network programming ...
Posted by coolbeansdude51 on Sun, 21 Nov 2021 11:01:45 -0800
Final topic exercise of information C language programming (personal summary)
1. Connect the circuit
Title Description:
As a student of department 2, Xiao Qiuyue is tired of connecting the circuit every day, and even the cat's ears and tail droop.
Now he is connecting a pile of resistors one by one. Please help him calculate the combined resistance of these resistors.
Input format:
Multiple groups of input, number o ...
Posted by jasonman1 on Sat, 20 Nov 2021 21:44:31 -0800
C language Tan Haoqiang topic - Chapter 5
Chapter V
EG 4
Among the 1000 students in the Department, collecting charitable donations will end when the total amount reaches 100000 yuan. Count the number of donations at this time and the average number of donations per person.
Problem solving idea: obviously, it should be handled by circulation. The actual number of cycles canno ...
Posted by blindtoad on Sat, 20 Nov 2021 20:08:23 -0800
[problem solution] lecture 100 on zero basics of algorithms (Lecture 31) multidimensional enumeration - Introduction
1, Recommended column
Lecture 100 on zero basis of algorithms (Lecture 31) multidimensional enumeration (I) - Introduction
2, Multidimensional enumeration
multidimensional enumeration is actually nesting loops, such as two-dimensional enumeration: nesting a for loop in a for loop.
#incldue <stdio.h>
int main(){
i ...
Posted by CerealBH on Sat, 20 Nov 2021 18:29:05 -0800
C language -- first knowledge of pointer
What is the pointer
In computer science, a pointer is an object in a programming language. Using an address (memory number), its value directly points to a value stored in another place in computer memory. Since the required variable unit can be found through the address, it can be understood that the address points to the change unit. The ...
Posted by Mhz2020 on Sat, 20 Nov 2021 18:25:54 -0800