Professional Documents
Culture Documents
Week 3, Arrays in C
Week 3, Arrays in C
• Examples:–
A[3] = x + y;
x = y – A[3];
z = sin(A[i]) + cos(B[j]);
CS-2301, B-Ter Arrays in C 2
m 2009
Array Elements (continued)
• Generic form:–
• ArrayName[integer-expression]
• ArrayName[integer-expression] [integer-
expression]
– Same type as the underlying type of the array
for (count=0;rc!=EOF;count++)
rc=scanf("%f", &A[count]);
• Static or automatic
• Array size determined explicitly or
implicitly
• Array size may be determined at run-time
• Automatic only
• Not in textbook
#define CLASS_SIZE 73
double B[CLASS_SIZE];