I thought the main function was the first called function. Later I found that the operating system would call a startup function to initialize the C ++ Runtime Library.
After the main function is returned, the operating system recycles resources,
String ExePath; // path ExePath = ExtractFilePath (Application-> ExeName); // the current directoryExePath = ExtractFilePath (ExcludeTrailingPathDelimiter (GetCurrentDir (); // The Directory address of the upper-level EXE program WriteLog (); // use
The C ++ copy constructor usually appears in the following situations:
1: when an object is passed in a function as a value
2: The object is returned from the function by passing the value.
3: one object is initialized through another object
4:
When writing a program, we often encounter two modules with similar functions. One is to process int data, the other is to process string data, or other custom data types, however, there is no way to write multiple methods to process each data type,
# Define _ CRT_SECURE_NO_DEPRECATE# Include // This file must be included when the string class is used.# Include Using namespace std; Int main (){String str1; // Input and OutputCout Cin> str1;Getchar ();Cout // Read a rowCout Getline (cin, str1
Q: I always fail to bind a socket. I can bind a socket only when I start the program for the first time, and then I will not be able to connect to this port when I use another program, however, I can scan this port using the port scanning software.
I. Examples
Taking my previous File System (FileSys) as an example:
A file system is an independent system that provides a set of core file operations.
In addition to the file system, there are four subsystems, namely the KillVirus, ZipFile,
I. Examples
We know that Iterator is provided in STL to traverse the Vector or List data structure.
The Iterator mode is used to solve the traversal problem of an aggregate object. It encapsulates the traversal of the aggregate into a class, so as
First, as extern is a keyword in C/C ++ that indicates the range (visibility) of the function and global variable. This keyword tells the compiler, the declared functions and variables can be used in this module or other modules.
In general, the
1 virtual is used to enable dynamic binding. In addition to the number of constructors, any non-static member function can be a virtual function. Virtual only appears in the member function declaration of the class and cannot be used in the function
I read some blogs about virtual functions and summarized them to list some important notes. Presumably, I only know this. After all, this is what I want.Want to see the principles of virtual functions can refer to this blog: http://www.bkjia.com/kf/2
This pointer can only be called in a member function of a class. It represents the address of the current object. The following is an example:Void Date: setMonth (int mn){Month = mn; // these three sentences are equivalent.This-> month = mn;(* This).
Author: eryar
Observer Pattern and the Document/View of MFCObserver mode and Document/View of MFC1. Observer Overview
The observer mode is the object behavior mode. It defines a one-to-many dependency between objects. When the State of an object
Traverse all natural numbers progressively from 0 until n numbers meet the requirements are obtained. Use the C ++ standard library bitset to save the binary value of natural number a. If the binary value meets the requirement of the question, save
[Cpp]/*Construct Optimal Solution*/# Include # Include # Define Max size 100Int n; // number of containersInt c; // capacityInt w [MAXSIZE]; // container weightInt r; // remaining weightInt cw; // current weightInt bestw; // optimal weightInt x
A: In the game, if A rectangle is placed in A circle with A radius equal to r, no one can place the circle and it will lose.At first, I was confused. I thought about it and found it symmetric. At first I put a circle in the center, and then I
Problem:To construct a 9*9 square matrix, players must fill in any number ranging from 1 to 9 in each square,The numbers in each column, row, and 3x3 matrix of the entire board are not repeated.
First, we use a deep priority search to generate a
(3) static and Singleton Modes
Because the storage location of static data members is fixed, actually, using pointers to access different instances of the same static data member accesses the same memory address. That is to say, accessing different
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