Website chia sẻ tài liệu, ebook tham khảo cho các bạn học sinh, sinh viên
// a very useful algorithm (missing from the standard library):
template
37 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1511 | Lượt tải: 0
Chỉ play dạng chuẩn dành cho audio kĩ thuật số trên nền tảng PC của Intel. File audio phải có kích thước thích hợp với bộ nhớ có sẵn. Không thể được sử dụng một cách đồng thời bởi nhiều tiểu trình trong cùng một tiến trình
7 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1425 | Lượt tải: 0
By default, use a vector You need a reason not to You can “grow” a vector (e.g., using push_back()) You can insert() and erase() in a vector Vector elements are compactly stored and contiguous For small vectors of small elements all operations are fast compared to lists If you don’t want elements to move, use a list You can “grow” a list (e...
43 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1443 | Lượt tải: 0
An introduction to the STL, the containers and algorithms part of the C++ standard library. Here we’ll meet sequences, iterators, and containers (such as vector, list, and map). The algorithms include find(), find_if(), sort(), copy(), copy_if(), and accumulate().
43 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1367 | Lượt tải: 1
We’ll see how we can change vector’s implementation to better allow for changes in the number of elements. Then we’ll modify vector to take elements of an arbitrary type and add range checking. That’ll imply looking at templates and revisiting exceptions.
38 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1415 | Lượt tải: 0
Think of a reference as an automatically dereferenced pointer Or as “an alternative name for an object” A reference must be initialized The value of a reference cannot be changed after initialization int x = 7; int y = 8; int* p = &x; *p = 9; p = &y; // ok int& r = x; x = 10; r = &y; // error (and so is all other attempts to change what r ...
35 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1251 | Lượt tải: 0
The next three lectures will show how the standard vector is implemented using basic low-level language facilities. This is where we really get down to the hardware and work our way back up to a more comfortable and productive level of programming.
32 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1276 | Lượt tải: 0
Graphical user interfaces Windows and Widgets Buttons and dialog boxes
50 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1299 | Lượt tải: 0
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: 1271 | 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: 1276 | Lượt tải: 0