before talking about function call and return value problem, let's look at the problem of memory allocation in C + +.
The C + + compiler divides computer memory into code areas and data areas, and it is clear that the code area is where the
Function call procedureC + + compiled to generate executable program file exe, stored in the external memory. The program starts, the system loads the executable file into memory from the external memory, and executes from the entry address (at the
The use of define is only a pure substitution function, and the substitution of the macro definition is the replacement that the preprocessor handles.
One: Simple macro-definition usage
Formatting: Replacing content with #define Identifiers
The
1. Matrix multiplicationmatrix multiplication should meet the conditions:(1) The number of columns in matrix A must equal the number of rows of matrix B, and matrix A and matrix B can be multiplied;(2) The row number of matrix C equals the number of
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
1. Const
A variable declaration with a keyword const means that the value of the variable cannot be modified by assignment, increment, or decrement , which is obvious. The pointer uses a const to be slightly more complex, because it has to be a
Bubble Sort MethodPrinciple:It repeatedly visits the sequence to be sorted, compares two elements at a time, and swaps them if their order is wrong. The task of visiting the series is repeated until no further exchange is needed, which means that
C language Tan () function: tangent functionheader file:
#include
The tan () function is used to find the tangent of a given value, and its prototype is:
Double tan (double x);
The "parameter" x is the given radian
C language Isupper () function: To determine whether the character is uppercase English lettersheader file:
#include
To define a function:
int isupper (int c);
Function Description: Check whether the parameter C is an
In C + +:
(1) The Register keyword cannot define a variable in the global, or it will be prompted as an incorrect storage class.
(2) when the Register keyword is declared in a local scope, the address can be taken with the & operator, and once the
C language strcpy () function: Copy string
Header files: #include
To define a function:
Char *strcpy (char *dest, const char *SRC);
Function Description: strcpy () copies the parameter SRC string to the address that the parameter
Minimum spanning Tree prim algorithm plain versionThere are a few points to explain.
1, 2 for loops start with 2, because we usually start by default to add the first node to the build tree, so we don't need to look for it again.
2, Lowcost[i]
Assignment of an object
If two or more objects are defined on a class, they can be assigned to each other, or the value of one object can be assigned to another object of the same kind. The value of the object referred to here is the value of all
Operator overloading is essentially an overload of a function
The functions of overloaded operators are generally formatted as follows:
function type operator operator name (parameter list column)
{Overloaded handling of operators}
For example,
1. Basic Concepts
A, path, and path length
If a node sequence k1,k2,......,kj is present in a tree, so that Ki is the parent of ki+1 (1
The number of branches that are passed from K1 to KJ is called the path length between these two points, which
1.exit (0) Normal exit procedure
Exit (1) program exception exits program
2.static (static variable) modifies local variables
Using static adornments in local variables prolongs the lifetime of local variables. But we need to pay attention to a
Watching the programmer's interview today, I happened to see the efficient access to arrays and pointers, idle boredom, wrote a paragraph of small code, a simple analysis of C language behind the compilation, may be a lot of people only pay
Copy Code code as follows:
Please follow the input binary tree elements (one character per node, empty node = ' = ') by First order:
abd==e==cf==g==
First-order recursive traversal:A B D E C F GIn-sequence recursive traversal:D B E
In simple terms, extern "C" is a C + + method of declaring or defining the symbols of the language, in order to be compatible with C. Easy to say, to understand it is still a lot of trouble, first of all, we should start from C + + and C difference.
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