TAILIEUCHUNG - Chapter 10 Pointers and Dynamic Arrays

The "address of" operator Also used to specify call-by-reference parameter. No coincidence!, Recall: call-by-reference parameters pass "address of" the actual argument | Chapter 10 Pointers and Dynamic Arrays Learning Objectives Pointers Pointer variables Memory management Dynamic Arrays Creating and using Pointer arithmetic Classes, Pointers, Dynamic Arrays The this pointer Destructors, copy constructors Pointer Introduction Pointer definition: Memory address of a variable Recall: memory divided Numbered memory locations Addresses used as name for variable You’ve used pointers already! Call-by-reference parameters Address of actual argument was passed Pointer Variables Pointers are "typed" Can store pointer in variable Not int, double, etc. Instead: A POINTER to int, double, etc.! Example: double *p; p is declared a "pointer to double" variable Can hold pointers to variables of type double Not other types! Declaring Pointer Variables Pointers declared like other types Add "*" before variable name Produces "pointer to" that type "*" must be before each variable int *p1, *p2, v1, v2; p1, p2 hold pointers to int variables v1, v2 are ordinary int .

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.