C++ Programming: From Problem Analysis To Program Design,: Third Edition
C++ Programming: From Problem Analysis To Program Design,: Third Edition
dataType arrayName[intExp];
where intExp is any expression that evaluates to a
positive integer
• The statement
int num[5];
declares an array num of 5 components of the
type int
• The components are num[0], num[1],
num[2], num[3], and num[4]
• String Input
cin.get(str, m+1);
strVar.c_str()
where strVar is a variable of type string
• For example:
int studentId[50];
char courseGrade[50];