Category Archives: c++

_ch1

Here are a few pointers to the areas in which C++ has better ways of doing something than C has: [1] Macros are almost never necessary in C++. Use c o n s t (§5.4) or e n u m … Continue reading

Posted in c++ | Leave a comment

继承与使用

private:private by default 定义类时,public,protected,private的顺序取决于不同理念 public  :公用的,可供其他 class 使用 Protected :保护的,可供自己的 class 使用,以及供自己的衍生类使用。对外部类而言,protected 的行为与 private 相同。 class B { private:     int x; protected:       int y;public:    void F1();};// A 继承自 B,B 是基类,A 是派生类,派生类A的成员包含了基类B中成员以及该类本身的成员。private by defaultclass A : B {        public:     … Continue reading

Posted in c++ | Leave a comment

eclipse_import file system

create a new project; import file system; select file directories that you want to add, Select All or deselect some files that you don’t want to add; select destination directory for source codes; You can also import folders and files … Continue reading

Posted in c++ | Leave a comment

c++_how_to_program_5th_ch9

#ifndef TIME_H           #define TIME_H         #endif   : used to prevent multiple inclusions of a header file. Data members of a class cannot be initialized where they are declared in the class body (except … Continue reading

Posted in c++ | Leave a comment

c++_how_to_program_5th_ch8

Pointers are variables that contain as their values memory addresses of other variables.   int *ptr;   There are three values that can be used to initialize a pointer: 0, NULL or an address of an object of the same type. … Continue reading

Posted in c++ | Leave a comment

c++_how_to_program_5th_ch7

type arryName[ arrySize ];  A subscript must be an integer or integer expression (using any integral type). Array subscripts begin at 0,  a[0]–>the 1st element.  Arrays may be of any type, char string1[ 20 ] ; or char string1[]="first";  The size … Continue reading

Posted in c++ | Leave a comment

c++_how_to_program_5th_ch6

Summary: Three ways to return control to the point at which a function was invoked: If the function does not return a result, control returns when the program reaches the function-ending right brace, or by execution of the statement : … Continue reading

Posted in c++ | 1 Comment

c++_how_to_program_5th_ch5

     for ( initialization; loopContinuationCondition; increment )         statement The scope of a variable specifies where it can be used in a program. For example, a control variable declared in the header of a for statement can be used only … Continue reading

Posted in c++ | Leave a comment

c++_how_to_program_5th_ch4

A null statement, indicating that no action is to be taken, is indicated by a semicolon (;). A value that contains a fractional part is referred to as a floating-point number and is represented approximately by data types such as … Continue reading

Posted in c++ | Leave a comment

The top c++ books

The Complete Reference C++ ,Herbert Schildt The C++ Programming Language by Bjarne Stroustrup International Standard for C++, ISO/IEC The C++ Standard Library,A Tutorial and Reference,by Josuttis Thinking In C++ Effective C++ by Scott Meyers, Addison-Wesley More Effective C++ Effective STL: … Continue reading

Posted in c++ | Leave a comment