CS 24000 Lecture Notes - Lecture 10: Java Syntax, Local Variable, Global Variable
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.