• Kĩ thuật lập trình - Chapter 17: Lvector and free storeKĩ thuật lập trình - Chapter 17: Lvector and free store

    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 ...

    ppt35 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 948 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 16: Graphical user interfacesKĩ thuật lập trình - Chapter 16: Graphical user interfaces

    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.

    ppt32 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 986 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 15: Functions and graphingKĩ thuật lập trình - Chapter 15: Functions and graphing

    Graphical user interfaces Windows and Widgets Buttons and dialog boxes

    ppt50 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1001 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 14: Graph class designKĩ thuật lập trình - Chapter 14: Graph class design

    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); };

    ppt33 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 977 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 13: Graphics classesKĩ thuật lập trình - Chapter 13: Graphics classes

    Simple_window win20(pt,600,400,"16*16 color matrix"); Vector_ref vr; // use like vector // but imagine that it holds references to objects for (int i = 0; i<16; ++i) { // i is the horizontal coordinate for (int j = 0; j<16; ++j) { // j is the vertical coordinate vr.push_back(new Rectangle(Point(i*20,j*20),20,20)); vr[vr.size(...

    ppt33 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 982 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 12: A display modelKĩ thuật lập trình - Chapter 12: A display model

    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...

    ppt45 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 931 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 11: Customizing I/ OKĩ thuật lập trình - Chapter 11: Customizing I/ O

    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

    ppt28 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 954 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 10: Input/ Output StreamsKĩ thuật lập trình - Chapter 10: Input/ Output Streams

    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

    ppt35 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1002 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 9: Technicalities: Classes, etcKĩ thuật lập trình - Chapter 9: Technicalities: Classes, etc

    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 ...

    ppt31 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 974 | Lượt tải: 0

  • Kĩ thuật lập trình - Chapter 8: Technicalities: Functions, etcKĩ thuật lập trình - Chapter 8: Technicalities: Functions, etc

    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";

    ppt33 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 981 | Lượt tải: 0