CS 24000 Lecture Notes - Lecture 10: Java Syntax, Local Variable, Global Variable

39 views2 pages

Document Summary

It ends with . h or . hh: example: stack. h, an implementation le. It ends with . cc, . cpp, or . cxx: example: stack. cpp, programs that use the c++ class should include the header le. This is called a memory leak : be careful not to delete an object while is still in use. Premature free : objects as local variables, you may also create an object as a local variable, the object will be deleted automatically when the function returns. It is used to create aliases of variables and to pass by references in functions: references have pointer semantics, you can do the same in pure c, passing by reference. If a parameter type of a function is a reference and the parameter is modi ed, then it will modify the variable passed as a parameter: notice that no pointer operations * are not necessary so it looks simpler.

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