Write log class in C + + language, support write log level setting, support multithreading, support deformable parameter table write log.Mainly provides the following interface:
1, set the level of write log
2, write key log information
Let's write a program that counts the number of numbers, whitespace characters (including spaces, tabs, and line breaks) and the occurrences of all other characters. The utility of this program is not very practical, but we can use the program to
The mkdir function is used to create a directory. The format is as follows:#include #include #include int mkdir (const char *pathname,mode_t mode);
Where the parameter pathname is the directory name of the newly created directory, mode specifies
We set up an array of Huffnode to save the information of each node in the Huffman tree. According to the nature of the binary tree, the Huffman tree with n leaf nodes has a total of 2n-1 nodes, so the size of the array huffnode is set to 2n-1. The
1. Reasons:
When implementing polymorphism, when using a base class pointer to manipulate a derived class, prevent only the destructor of the base class without the destructor of the derived class at the time of the destructor.
2. Example:
(1),
Replication of C + + objects
It is sometimes necessary to use multiple identical objects, for example, each product of the same model is the same from the external to the internal properties, if you want to process each product separately, you need
Separation of common interface and private implementation
C + + implements encapsulation through classes, encapsulating data and operations related to the data in a class, or the role of a class in encapsulating data and algorithms in an abstract
1. Why to introduce virtual inheritanceVirtual inheritance is a unique concept in multiple inheritance. The virtual base class appears to resolve multiple inheritance. For example, Class D inherits from class B1, B2, and class B1, B2 inherit from
C + + structure arrayA structural body variable can hold a set of data (such as a student's number, name, grade, etc.). If there are 10 students whose data needs to be in operation, it is obvious that an array should be used, which is the structure
Composition and writing form of C + + program1 A C + + program can be composed of one program unit or multiple program units. Each program unit acts as a file. When the program compiles, the compilation system compiles each file separately, so a
C language Sigprocmask () function: query or set a signal maskheader file:
#include
To define a function:
int sigprocmask (int how, const sigset_t *set, sigset_t * oldset);
Function Description: Sigprocmask () can be used to
C language Sigismember () function: test whether a signal has been added to the signalheader files: #include
Definition function: int sigismember (const sigset_t *set, int signum);
Function Description: Sigismember () is used to test whether the
C language Link () function: Establish a File connectionheader file:
#include
To define a function:
int link (const char * oldpath, const char * newpath);
Function Description: Link () Creates a new connection (hard
C language creat () function: Creating a file function
Header file:
#include #include #include
To define a function:
int creat (const char * pathname, mode_tmode);
Function Description:1, parameter pathname point to
C language Getgrent () function: Get account data from group fileheader file:
#include #include
To define a function:
struct Group * getgrent (void);
Function Description: Getgrent () is used to read a group of data
In the process of writing code, often output some debugging information to the screen, will normally call printf this kind of function.But when debugging is done, we need to manually remove or annotate these places.Recently watching the "Linux C
C language Isalnum () function: To determine whether a character is an English letter or a numberheader file:
#include
Isalnum () is used to determine whether a character is an English letter or a number, equivalent to Isalpha (c) | |
C language Toascii () function: Converts a character to the corresponding ASCII codeheader file:
#include
To define a function:
int toascii (int c);
Function Description: Toascii () converts the parameter C to a 7-bit
Char variables in the C language
Char is one of the more bizarre in C/s + + Integer data, and the other, such as Int/long/short, when not specified signed/unsigned, is signed by default. Although Char is unsigned in the standard (since the char
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service