CS 2150 Lecture Notes - Lecture 4: Null Pointer, Subroutine, Ampersand
Document Summary
Lecture 4: c++ syntax: , ampersand can still be used on a variable that hasn"t been declared because it stills has an address. Initially, pointers do not point to anything. ii. iii. = makes one thing point to the same thing. Int **y is a pointer to a pointer of things: pointer pitfalls: same pointee, common way to initialize a pointer is to set it equal to null, which means that it would point to the electrical ground symbol. Does not do a null pointer check, and c++ would result in a segmentation fault error. Can be igured out at compiled time, such as int x: dynamic memory allocation: space on the ly, or at run time, once you"re done with an array, delete it. Deleting objects with the use of the garbage collection slows java down. C++, everything declared with new must be deallocated with delete.