CS138 Lecture Notes - Lecture 6: Type Safety, Bounds Checking, Call Stack

80 views3 pages

Document Summary

Vector is a container data structure from c++ std: like a c-style array except . Either one element at a time or in chunks: other stl data structures: Iterating through a vector: simple, normal, numerical approach, abstract, powerful but confusing way w/ stl iterators. C/c++/java/python memory model: in c/c++, program is binary. Compiled from source code: rte may be bundled into binary (statically linked libs) or not (dynamically linked libs, in java/c#, we compile source to byte code . A virtual machine (jvm/clr) acts as runtime/abstract os: in python/perl/scheme/racket/lisp, run time is interpreter that runs raw source code. Creating struct/class instances in c+: direct (static) instantiation. However, this can be a problem if we want to create linked structures that live beyond current procedure: dynamic instantiation (usually thru a ptr) Must remember to delete storage when you are done. C++ pointers: are basically a strange number with strange arithmetic, can point to just about any kind of thing.

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