Master the C/C ++ points (3 ).
12. macro definition
I have not paid much attention to the following 3.1 cases. At least I did not know before, but these three points are very important. Only macros that meet these three requirements are
// Single-source shortest path Bellman_Ford algorithm. cpp: Defines the entry point for the console application.
//
# Include "stdafx. h"
# Include
# Deprecision MAX 100
# Define Infinity 65535
Typedef int WeiType;
Using namespace std;
Struct
Question: How to design a container that can contain objects of different types but related to each other?
Problem description: how to copy unknown objects of the compilation type?
Solution 1: Use the container to store pointers to objects and
Master the key points of C/C ++ (5) -- mutable and volatile
14. Variable Length Parameters
It is possible to design a function with variable number of parameters and variable parameter types. The most common examples are printf, scanf, and
1. object initialization in the same compilation unit.
Class PhoneNumber {.....};
Class Info
{
Public:
Info (const std: string name, const std: string address, const std: list phonenum): m_Name (name), m_Address (address ), m_PhoneNum (phonenum)
{
I wrote a code today and I always reported an error. It was originally a left-handed Problem of a string, but I was always bored when I reported an error. Then I went online to answer questions from enthusiastic netizens, and I was very
The question is shown in the question.
The Code is as follows:
Www.2cto.com
Int findSubStringNUM (const char * targetString, const char * subString ){
Assert (NULL! = TargetString | NULL! = SubString );
Int I = 0;
Int j = 0;
Int num = 0;
While
I saw a C ++ post on the BBS. Is the C ++ child going astray ?, It reminds me of ordinary youth and literary youth. BytesBytesLook at this typical NB program and find the number of bits.
Common C ++ programmers
Namespace traditional { Int bits_of
13.5.2 define value typeObjects defined by classes with value semantics act like arithmetic objects, and vice versa. The string class is an example of a value type class.The copy constructor no longer copies pointers. It will allocate a new int
Check the data range ~~ Up to 100... think about it... all the results obtained by the answer must be smaller than 100... so the three-layer for loop to brute force find the optimal solution to meet the requirements is OK .. it's disgusting .. the
14.8 call operators and function objectsStruct absInt {Int operator () (int val ){Return val }};Int I = 100;AbsInt absObj;Cout Function call operators must be declared as member functions. A class can be defined as multiple versions of the function
15.6 pure virtual functionsWrite = 0 after the function list to specify the pure virtual function.Defining a function as a pure virtual function (pure virtual function) indicates that this function provides an interface that can be overwritten for
I. Tutorial Purpose
Understand the principles of I/O multiplexing technology.
Learn to write basic Single-thread concurrent server programs and customer programs.
Ii. Experimental Platform
Ubuntu-8.04 Operating System
Iii. experiment content
I/O
16.4.1 class template member functions
The class template member functions are defined as follows:
It must start with the keyword template, followed by the template parameter table of the class.
You must specify the member of the class.
The class
Previous: http://www.bkjia.com/kf/201201/116372.html18.5 Union: space-saving classUnion is a special class. A union object can have multiple data members, but only one member can have a value at any time. When a value is assigned to a member of the
Assume that the server has the Mongo database MyDB, including the MyTable table and the fields "IP" and "Date", which respectively record the Client IP address and access time for accessing the service, account User with access permission to the
Clause 16: The new and delete pairs must take the same form.
Use the same form in corresponding uses ofnew and delete
When you use delete For a pointer, the only way to let delete know whether there is an "array size record" in the memory is to tell
The static members in the class are really a fascinating feature. I decided to summarize the knowledge points of static class members so that I would not be passive in future interviews.Static class members include static data members and static
In terms of concept, constructor can be considered to be implemented in two phases:1. Initialization phase;2. Common computing stage. (The computing stage consists of all the statements in the constructor)Whether or not the Members display
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.