1. Trang chủ
  2. » Công Nghệ Thông Tin

Lecture Programming in C++ - Chapter 18: Miscellaneous topics

24 63 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 24
Dung lượng 500,2 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Lecture Programming in C++ - Chapter 18: Miscellaneous topics. On completion of this chapter students will know how to: Benefits of multiple file organization, how to use header files, how to use bitwise operators, how to work with binary files.

Trang 1

Topics

Trang 2

Makes possible to accommodate many 

programmers working on same project

More efficient to manage large amount of source code

Can incorporate class libraries in separate files from independent vendors

Lesson 18.1

Trang 7

More efficient connecting files with IDE

– Integrated Development Environment

Save correctly working files as object codeLink after all changes have been recompiled

Lesson 18.1

Trang 8

Very low­level operations

Manipulate individual bits (1s and 0s)C++ provides bitwise operators

Trang 10

Left shift <<

Lesson 18.2

Trang 12

bitwise  And / inclusive ORWork similar to counterparts && and ||

Trang 13

Lesson 18.2

   Bitwise AND     Bitwise OR

hex 3   0 0 1 1  hex 3   0 0 1 1     &      |

hex 6         0 1 1 0       hex 6        0 1 1 0    =      =

&&&&  |  |  |  |

Trang 14

~(1010) = 0101

Lesson 18.2

Trang 15

0 ^ 0 = 0 1 ^ 1 = 0

0 ^ 1 = 1 1 ^ 0 = 1

Lesson 18.2

Trang 17

Can shift more than one bit

Bitwise operators can only be used on integer data types

All systems do NOT use same bitwise representations

– May get different results

Lesson 18.2

Trang 18

Efficient since do not have to convert from ASCII

Trang 20

Opening Input File  for Reading in Binary

ifstream  in_ob (“name”, ios :: in | ios :: binary);

programmer­chosen input file object name

filename

Lesson 18.3

Trang 22

Number of bytes to be copied from file to memory Operator that makes C++ interpret address

    to represent beginning of an array of 

    characters

Trang 24

Benefits of multiple file organizationHow to use header files

How to use bitwise operators

How to work with binary files

Ngày đăng: 30/01/2020, 03:33

TỪ KHÓA LIÊN QUAN