TAILIEUCHUNG - Lecture Practical C++ programming - Chapter 9: Variable scope and functions

Chapter 9 introduce students to local variables. First familiarize the students with the concepts of when variables are created and destroyed. This will prepare them for classes where variable creation and destruction my result in a function call. This chapter also introduce the tricky subject of recursion. | Chapter - 9 Variable Scope and Functions Practical C Programming Copyright 2003 O Reilly and Associates Page 1 Variable Scope and Class Variables are defined by two attributes Scope The area where a variable is valid Local or Global Storage Class Describes the storage allocation of the variable Permanent or Temporary Practical C Programming Copyright 2003 O Reilly and Associates Page 2 Variable Scope Global variables are valid everywhere. Local variables are only valid inside the where they are defined. Scopiof globa Ậ a global variable int main 4nt locaA 1 Scope of local global 1 local 2 Scionpte voefr eginning a new block a local variable global can be used here so can local this is local to the block global local very_locaal L Block closed very_local can not be used return 0 Practical C Programming Copyright 2003 O Reilly and Associates Page

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.