CS 2150 Lecture Notes - Lecture 4: Null Pointer, Subroutine, Ampersand

47 views1 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents