CS 1050 Ries Exam 2 Questions With
Complete Answers
arrays - ANSWER data structures consisting of related data items of the same type and
are static; specify name and position number of particular element in array to refer to
particular location in array
-name of an array is an address
static - ANSWER remain the same size throughout program execution
position number - ANSWER c[0] what is 0
name of array - ANSWER c[0] what is c
zeroth element - ANSWER first element in every array
array names - ANSWER can contain only letters, digits and underscores and cannot
begin with a digit (same rules as naming variables)
can be thought of as constant pointer so...
bPtr = b
bPtr = &b[0] --> equivalent statements
, subscript - ANSWER the position number contained within square brackets is also known
as ___ (index); must be integer or integer expression
general array form - ANSWER dataType arrayName[size] --> specify type of each
element and number of elements required by each array so that computer may reserve
appropriate amount of memory because arrays occupy space in memory
initializers - ANSWER int n[3] = {1,2,3} what is 1, 2, 3; if there are fewer ___ than elements
in array, the remaining elements are initialized to 0; NOTE: arrays are NOT automatically
initialized to 0 ie must at least initialize first element to 0 for remaining elements to be
automatically zeroed
array size - ANSWER if ___ is omitted from a definition with an initialized list, the number
of elements in array will be the number of elements in the intiializer list
symbolic constant - ANSWER #define SIZE 10 what is SIZE; identifier that is erplaced with
replacement text by the C preprocessor BEFORE program is compiled --> when program
is preprocessed, all occurrences of SIZE are repalced with replacement text 10
scalable - ANSWER can change things in program easily
10; - ANSWER #define SIZE 10; what are all occurrences of symbolic constant SIZE
replaced with --> leads to syntax errors at compile time or logic errors at execution time
Complete Answers
arrays - ANSWER data structures consisting of related data items of the same type and
are static; specify name and position number of particular element in array to refer to
particular location in array
-name of an array is an address
static - ANSWER remain the same size throughout program execution
position number - ANSWER c[0] what is 0
name of array - ANSWER c[0] what is c
zeroth element - ANSWER first element in every array
array names - ANSWER can contain only letters, digits and underscores and cannot
begin with a digit (same rules as naming variables)
can be thought of as constant pointer so...
bPtr = b
bPtr = &b[0] --> equivalent statements
, subscript - ANSWER the position number contained within square brackets is also known
as ___ (index); must be integer or integer expression
general array form - ANSWER dataType arrayName[size] --> specify type of each
element and number of elements required by each array so that computer may reserve
appropriate amount of memory because arrays occupy space in memory
initializers - ANSWER int n[3] = {1,2,3} what is 1, 2, 3; if there are fewer ___ than elements
in array, the remaining elements are initialized to 0; NOTE: arrays are NOT automatically
initialized to 0 ie must at least initialize first element to 0 for remaining elements to be
automatically zeroed
array size - ANSWER if ___ is omitted from a definition with an initialized list, the number
of elements in array will be the number of elements in the intiializer list
symbolic constant - ANSWER #define SIZE 10 what is SIZE; identifier that is erplaced with
replacement text by the C preprocessor BEFORE program is compiled --> when program
is preprocessed, all occurrences of SIZE are repalced with replacement text 10
scalable - ANSWER can change things in program easily
10; - ANSWER #define SIZE 10; what are all occurrences of symbolic constant SIZE
replaced with --> leads to syntax errors at compile time or logic errors at execution time