| Illustration of array limitations in C: Cannot assign. | Lecture 1 - slide 15 : 29 Program 5 |
#include <stdio.h>
int main(void) {
double a[10], b[10];
int i;
for(i = 0; i < 10; i++) /* Initialization */
a[i] = i;
b = a; /* Compiler error: incompatible types when assigning
to type double[10] from type double * */
for(i = 0; i < 10; i++)
printf("b[%d] = %f\n", i, b[i]);
return 0;
}