COMP 206 Lecture Notes - Lecture 24: C Dynamic Memory Allocation, Global Variable, Local Variable

11 views6 pages

Document Summary

October 31 structs, dynamic memory, function pointers. We"ve talked about low-level c, such as bit-wise operations and pointers, and how the memory works. But we are missing some functions of different languages that we are used to building programs with, like a class-like structure. Some other languages like python and java give you a class feature, which put together a bunch of functionality. These classes can also have methods (assigning a grade to a student, for example). The methods interact with the data of that particular object in order to make more structured programs. If you program in c without objects, it is okay, but you will have a lot of local variables. You could just store all the students you"d put in the class as objects, instead in an array. But a cleaner way would be to combine structs, dynamic memory, and function pointers .

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