The ANSI C functions below exist in two separates files as shown. Compilation fails when the files are compiled for an embedded system. Which of the following statements correctly describe causes of the compilation problems?
File A
struct pair { int x, y; };
struct pair a[10];
/*initialize the x-y pairs in the array*/
void initialize (int x. int m, int b)
{
int i;
a[0].y=(a[0].x= x) * m+b;
for (i=1; i< 10; ++i)
a[i].y = (a[i].x= a[i-1].x+1) *m +b;
}
File B
struct pair { int x, y; };
/* Return a pointer to the pair with the given x value.
Return a pointer to the flrst pair in the array if the given x value does not exist; */
struct pair *op(int x)
{
int i;
for (i = 10; i>0; --i)
if (a[i].x== x)
break;
return a * i;
}
extern struct pair a[];
A.The returned pointer is invalid unless the array is declared as extern in all files with functions that call op()
B.The definition of struct pair is missing the extern keyword in both fles
C.The size of the array must be specified in File B
D.The declaration of array a must occur before the definition of op ()
E.The definition of the array a is missing tne extern keyword in File A
--
FROM 1.147.120.*