Boost smart pointer - scoped_ptr

boost::scoped_ptr and std::auto_ptr is very similar. It is a simple smart pointer, which can ensure that the object is automatically released after leaving the scope. The following code demonstrates the basic application of this pointer: #include <string> #include <iostream> #include <boost/scoped_ptr.hpp> class implementati ...

Posted by rsassine on Sat, 30 Oct 2021 21:46:14 -0700

How to systematically learn C language documents

The program source code we write and the executable files generated by compilation belong to files. Therefore, the essence of a file is a continuous piece of binary data stored on an external storage medium. c language program processes files in the form of file stream. The program runs in memory, and the files are stored on external storage ...

Posted by MasK on Sat, 30 Oct 2021 19:44:48 -0700

Introduction to C language basic data types

  The above picture lists the keywords that define data types, and indicates the occupation and value range of different types in 32-bit machines. Next, let's briefly introduce these three data types. 1. Integer: there are two types of integers: signed and unsigned. Signed integers can be regarded as compatible with negative integers, w ...

Posted by daedlus on Sat, 30 Oct 2021 11:57:17 -0700

Codeforces Round #752 (Div. 2) A B C D

Codeforces Round #752 (Div. 2) Record high!! A. Era Idea: at first, I thought it was to find a maximum subscript, and then output the maximum minus the maximum subscript. Later, I dropped this idea with the data 1 1 5 1 6 hack, and it was obvious that as long as I enumerated it, I saved the largest memory ...

Posted by jaybeeb on Sat, 30 Oct 2021 11:24:42 -0700

Java layout menu

-Divide the parts into whole and encapsulate the method (multiple buttons will be set in one interface, which can be written in array, and less code can be written) String[]string={"rectangle","triangle","circular","Trisection point"}; -Containers are divided into top-level container JFrame and general container JPanel -JFrame is the def ...

Posted by mort on Sat, 30 Oct 2021 08:54:31 -0700

The fifth day of C + + Learning

1, Multiple choice questions 1. Perform the following procedure char *str; cin >> str; cout << str; If you enter abcd 1234, output (D) A. abcd         B. abcd 1234         C.1234         D. Output garbled code or error str is a char * pointer, uninitialized, an ...

Posted by Bricktop on Sat, 30 Oct 2021 07:15:45 -0700

Crazy God. Java method learning

1, What is method System.out.println(), so what is it? A: System is "class". out is "output object". println() is "method". A Java method is a collection of statements that together perform a function. Method is an ordered combination of steps to solve a class of problemsMethod contained in a class or object ...

Posted by predhtz on Sat, 30 Oct 2021 06:47:39 -0700

C language notes - circular entry questions and guessing games

1, Sort three numbers Method 1: function #include<stdio.h> int MAX(int a,int b) { int max=a>b?a:b; return max; } int MIN(int a,int b) { int min=a<b?a:b; return min; } int main() { int a=0,b=0,c=0; scanf("%d %d %d",&a,&b,&c); int max=MAX(MAX(a,b),c); int min=MIN(MIN(a,b),c); int mid ...

Posted by JamesWebster on Sat, 30 Oct 2021 03:37:02 -0700

Java string

  catalogue 1, Traversal string 2, Count the number of various characters 3, Splice string 4, String inversion 1, Traversal string public static void StringTest03(){ System.out.println("Please enter a string:"); String str = sc.nextLine(); for (int i = 0; i < str.length(); i++){ System.out. ...

Posted by jgh84 on Fri, 29 Oct 2021 21:07:49 -0700

Comprehensive analysis of IO stream (including NIO description)

Use of File class summary An object of the File class that represents a File or a File directory (commonly known as a folder) The File class is declared under the java.io package File class involves the creation, deletion, renaming, modification time, file size and other methods of files or file directories There is no operatio ...

Posted by dankstick on Fri, 29 Oct 2021 21:05:20 -0700