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

An overview of Cplusplus

35 232 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 35
Dung lượng 669 KB

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

Nội dung

Shift right operator ???How does a shift right operator produce output to the screen?...  C++ defines the bool datatype, and keywords true any nonzero value and false zero... OVERLOADI

Trang 1

AN OVERVIEW OF  C++

1

Trang 12

Shift right operator ???

How does a shift right operator produce output

to the screen?

Trang 15

{ char str[16];

Trang 20

 C++ defines the bool datatype, and keywords 

true (any nonzero value) and false (zero)

20

Trang 21

OVERLOADING

 Provides the mechanism by which C++ achieves one type of polymorphism (called compile­time 

polymorphism)

 Two or more functions can share the same name as long as either

 The type of their arguments differs, or

 The number of their arguments differs, or

 Both of the above

21

Trang 24

INTRODUCING  CLASSES

24

Trang 26

Example : cons­des­0.cpp

26

Trang 29

default constructor  and  is  supplied  by  the  compiler 

automatically  if  no  constructor  defined  by  the programmer

 The  compiler  supplied  default  constructor  does  not  initialize the member variables to any default value; 

Trang 30

 Just  like  pointers  to  other  types,  an  object  pointer, when  incremented,  will  point  to  the  next  object  of  its type.

Example: obj.cpp

30

Trang 31

 Functions that are not actually called but, rather, are expanded in line, at the point of each call

Trang 32

 A static variable

 A loop, switch or goto

 A return statement

 If the function is recursive

Trang 33

 Defining  a  member  function  inside  the  class declaration  causes  the  function  to  automatically become an in­line function

Ngày đăng: 23/10/2014, 15:07

TỪ KHÓA LIÊN QUAN