If there are deficiencies, also hope to correct the point!
Copy Code code as follows:
BinaryTree.cpp: Defines the entry point for a console application.
C + + implementation chain binary tree, the use of a non-recursive way to preface,
Personal implementation Examples:
Copy Code code as follows:
#include
#include
#define M 4
int add (int a, int b);
int sub (int a, int b);
int mul (int a, int b);
int div (int a, int b);
Int (*oper_func[]) (int, int) = {
Add,
1.sizeof is the operator, which is essentially the same as the nature of the subtraction, executed at compile time, not at runtime.So what if this is validated in programming? PS: This is the first two days of friends Taobao interview a problem ,
In C + +, there is a stream this class, all I/O is based on this "flow" class, including the file we want to know i/o,stream this class has two important operators:
1. Inserting device (Output data to the stream. For example, the system has a
Objective:
Remember to do this because then one day to know the original black box inside the cursor is controllable, but also often hear people talk about this, exercise a bit better.
Before the completion of the 1.0 version, now want to put up
First look at some of the relevant concepts of the sorting algorithm:1, stable sort and unstable sortSimply put, all the equal numbers, after some sort of sorting method, can still keep their relative order before they are sorted, we say this sort
We can write programs in a variety of ways for a particular task. The following code can also implement the function of the previous temperature conversion program: #include
/* Print Fahrenheit temperature-Celsius temperature
Install Openmpibecause is the experiment, also does not carry on the multiple machine configuration, only installs in the virtual machine. The configuration of multiple machines can refer to this articleThe easiest way, apt to install
sudo
The time () function can be used to obtain the current calendar times of the computer system, and the function that processes the DateTime is based on the return value of this function. Its prototype is:
time_t time (time_t * t);If you have
C language A total of 32 keywords, as described below:
Auto: Declaring automatic variables
Short: Declaring an integer variable or function
int: Declaring an integer variable or function
Long: Declaring an integer variable or function
float:
Using sizeof in C + + is much more complicated than C, because there are static variables in C + + classes, virtual functions, and inheritance, derivation, and so on. sizeof is a single order operator in C language, such as other operators in C + + 、
1. Triangle on outputThe first line is 1 stars, the second row is 3 stars, the third row is 5 stars, the fourth row is 7 stars, and the fifth row 9 stars.
Analysis:The shape of the triangle by the output of the blank and star composition, by
Copy Code code as follows:
When you do floating-point programming, if you don't pay attention, you will often see output like 1 #IND, 1 #INF or Nan, INF, and so on. This usually implies an exception to the floating-point operation.
Array of pointersDefined:If an array whose elements are pointer data, the array is an array of pointers, that is, each element in the pointer array corresponds to a pointer variable whose value is the address.
Form:The one-dimensional pointer array
There are three main functions of static:(1) Local static variables(2) External static variables/functions(3) static data member/member functionThe first two kinds of C and C + + have, the third is only in C + +, the following are described below:
The this pointer can only be invoked in a member function of a class, which represents the address of the current object. Here is an example:
Copy Code code as follows:
void Date::setmonth (int mn)
{
month = MN; These three
Let's take a look at the following code:
#include #include #include using
namespace Std;
Class Cntcharacters {Private:int cnt; Public:cntcharacters (): CNT (0) {} ~cntcharacters () {} void Opentxt (char* p)
{ifstream fin;
C + + A constant pointer to an objectDeclare the pointer variable to be a const type so that the pointer value remains its initial values and cannot be changed.
Such as:
Time T1 (10,12,15), T2; Defines the object time
* const
Create a main form (FormMain), two sub-forms (FORM1,FORM2), add a MenuStrip control, TabControl control, and add a main menu and two submenus to the menu control, respectively, in the main form, such as: Then, select the TabControl control
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