To override a virtual function, you need A virtual function Exactly the same name Exactly the same type struct B { void f1(); // not virtual virtual void f2(char); virtual void f3(char) const; virtual void f4(int); };
33 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 977 | Lượt tải: 0
Simple_window win20(pt,600,400,"16*16 color matrix");
Vector_ref
33 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 982 | Lượt tải: 0
Circle c(Point(100,200),50); // center, radius Ellipse e(Point(100,200), 75,25); // center, horizontal radius, vertical radius e.set_color(Color::dark_red); Mark m(Point(100,200),'x'); ostringstream oss; oss << "screen size: " << x_max() << "*" << y_max() << "; window size: " << win.x_max() << "*" << win.y_max(); Text sizes(Point(100...
45 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 931 | Lượt tải: 0
Binary literals 0b1010100100000011 Digit separators 0b1010'1001'0000'0011 Can also be used for for decimal, octal, and hexadecimal numbers User-Defined Literals (UDLs) in the standard library Time: 2h+10m+12s+123ms+3456ns Complex: 2+4i
28 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 954 | Lượt tải: 0
What logical parts do we what? int get_int(int low, int high); // read an int in [low.high] from cin int get_int(); // read an int from cin // so that we can check the range int void skip_to_int(); // we found some “garbage” character // so skip until we find an int Separate functions that do the logically separate actions
35 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1002 | Lượt tải: 0
Essential operations Default constructor (defaults to: nothing) No default if any other constructor is declared Copy constructor (defaults to: copy the member) Copy assignment (defaults to: copy the members) Destructor (defaults to: nothing) For example Date d; // error: no default constructor Date d2 = d; // ok: copy initialized (copy the ...
31 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 974 | Lượt tải: 0
A namespace is a named scope The :: syntax is used to specify which namespace you are using and which (of many possible) objects of the same name you are referring to For example, cout is in namespace std, you could write: std::cout << "Please enter stuff \n";
33 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 981 | Lượt tải: 0
Case/Combo: + Nếu làm theo cách tổ hợp nội lực, xem và xuất kết quả của tưng trường hợp tải trọng TT, HT1, HT2, GT, GP, DDT,DDP. + Nếu làm theo cách tổ hợp tải trọng, chỉ cần tập trung vào các loại tổ hợp sau: TH1 : TT + HT1 TH1 : TT +.9( HT1+HT2) • Component: + Xem các thành phần, với khung phẳng trong mp X-Z là: + Axial Forces + Shear Fo...
39 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1131 | Lượt tải: 0
We did not (yet) add Negative numbers % (remainder/modulo) Pre-defined symbolic values Variables Read about that in Chapter 7 % and variables demonstrate useful techniques Major Point Providing “extra features” early causes major problems, delays, bugs, and confusion “Grow” your programs First get a simple working version Then, add fea...
31 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 942 | Lượt tải: 0
Completing a program Tokens Recovering from errors Cleaning up the code Code review Testing
39 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1050 | Lượt tải: 0