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+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents