Computer Science 2211A/B Lecture Notes - Lecture 8: Bus Error, Core Dump, Segmentation Fault

93 views1 pages

Document Summary

Scalar: capable of holding single data item. One dimensional arrays more important in c than multidimensional. One dimensional array size*sizeof(int) bytes reserved in memory. Data structure containing a number of elements where all values are the same type. Simplest kind of array (one dimension), like a single row. Can use a[0], or for scanf &a[0] Macros: used to define arrays (eg. #define months 12 \n int arry[months]) In gnu c, variable length array is allowed, but in ansi c is more complicated. Initialize array can be done by a comma separated list (eg. int array[4] = {1,2,3,4,5};) Can also let compiler figure out size (eg. int array[] = {1,2,3,4,5};) When array name is used by itself, the value is the address of the array. C does not check array bounds during compilation (although some will check literals) or during runtime (never checked)

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