Category:C++

  • C + + primer notes Chapter 13 copy control

    Time:2021-3-1

    Copy and move constructorsDefines what to do when initializing this object with another object of the same type.Copy and move assignment operatorsDefines what to do when an object is assigned to another object of the same type.DestructorDefines what to do when an object of this type is destroyed. We call these operationsCopy control operation。 If […]

  • This is a short essay

    Time:2021-2-27

    The little fish is more lovely than the little fish   describe People are more angry than people; fish are more difficult to die than fish. Xiaoyu recently took part in a “loveliness contest” to compare the loveliness of each fish. The fish in the competition are arranged in a row from left to right, […]

  • Meditation on C + + template

    Time:2021-2-26

    On abstraction — Preface The story starts with a function that seems very simple: Please calculate the sum of two numbers. If you’re familiar with Python, you’ll think, “Wow! It’s so simple! ” Then write the following code: def Plus(lhs, rhs): return lhs + rhs So what about C? You need to face this problem: […]

  • Jpg learning notes 4 (with complete code)

    Time:2021-2-24

    The third step of JPG coding is quantization. For the 8 * 8 block data after DCT change, we need to quantify the 8 * 8 data. In JPEG, quantization is to divide the data V by a certain number Q to get round (V / Q) instead of the original data. Then, when JPG […]

  • Jpg learning notes 5 (with complete code)

    Time:2021-2-23

    The fourth step of JPG compression is Huffman coding. The following is mainly about the Huffman coding of JPEG. The picture is quoted from “compressed image file formats, JPEG, PNG, GIF, XBM, BMP – John Miano” [1] 1. Huffman symbol of AC data For AC data, the first four bits to be encoded represent how […]

  • Thorough understanding of implicit type conversion in C + +

    Time:2021-2-22

    Implicit type conversion can be said to be our old friend, in the code we will more or less rely on C + + implicit type conversion. Unfortunately, implicit type conversion is also a big hole in C + +. It’s easy to write all kinds of wonderful bugs without paying attention. Therefore, I want […]

  • C / C + + programming diary: strategy play strange text games (repair optimization version with source code)

    Time:2021-2-12

    This game is very simple. It is a game composed of a for loop, several while and multiple if statements   #includeusingnamespacestd;intmain(){intshengming=30,gongji=10,jinbi=10,smsx=30,duobi1=3;inta=0,b=0,c=0,d=0;cout< for(inti=0;i<1;i–){cout<>a;if(a==1){while(1){cout<=10″<=40″<=15″<>b;if(b==1&&jinbi>=10){ while(1){cout<>c;if(c==1&&jinbi>=10){gongji+=5;jinbi-=10;cout<=50){gongji+=25;jinbi-=50;cout<   <=200){gongji+=100;jinbi-=200;cout<=1000){gongji+=500;jinbi-=1000;cout< {break;}elseif(c>3){cout<=10){shengming=smsx;jinbi-=10;cout<=40){while(1){cout<>c;if(c==1){smsx+=10;shengming+=10;jinbi-=40;cout< <=100){smsx+=25;shengming+=25;jinbi-=100;cout<=400){smsx+=100;shengming+=100;jinbi-=400;cout<=2000){smsx+=500;shengming+=500;jinbi-=2000;cout< <=15){while(1){cout<>c;if(c==1){duobi1+=1;jinbi-=15;cout<   <=100){duobi1+=10;jinbi-=150;cout<=400){duobi1+=20;jinbi-=300;cout< <=2000){duobi1+=100;jinbi-=1500;cout< Hit 100 to get 100 “gold coin”<>b;if(b==1){intsm=20,gj=10;intduobi=duobi1;cout<0){cout<>c;if(c==1){shengming-=gj;sm-=gongji;cout<0){cout< < <0){cout<>c;if(c==1){shengming-=gj;sm-=gongji;cout<0){cout<   <0){cout<>c;if(c==1){shengming-=gj;sm-=gongji;cout< <0){cout< <0){cout< Enter: C; if (C = = 1) {Shengming – = […]

  • Reflections on Eagle’s egg

    Time:2021-2-11

    What number should I guess next ? The inspiration of this article comes from the recent team building of the Ministry of technology and the famous DP optimization “Eagle Egg”. I remember a month ago, when I discussed with my classmates, I always tried to find a fixed mode to make decisions. However, there are […]

  • Study day 46

    Time:2021-2-10

    C++ 1. Constructor 1. For a special member in a class, its name is the same as the class name. When creating a class object, the special member will be automatically called by the system 2. Forget to call manually 3. The purpose is to initialize the data members of class objects 4. The constructor […]

  • Learning notes of C + +++

    Time:2021-2-9

    C + + is an intermediate language, which was designed and developed by Bjarne Stroustrup in Bell Labs in 1979. C + + is an object-oriented programming language, which further expands and perfects C language. C + + can run on a variety of platforms, such as windows, Mac operating system and various versions of […]

  • The function of setregistrykey

    Time:2021-2-8

    come from: http://blog.sina.com.cn/s/blog_ 65cab32d01012a0l.html   When using the MFC framework, there is always a setregistrykey (“string XXX”) in the initinstance() function of the app application class during initialization. I don’t know what it is used for. I checked it carefully this day and found that if you use the registry, it provides you with a […]

  • My first “game”

    Time:2021-2-7

    Output a bunch of punctuation marks   Before playing tribal conflict, I met a group of children. When chatting in QQ group, I like to brush the screen with punctuation.When you want to do a lot of punctuation output program to show them, and then write the code. This is also my first game,Although it’s […]