I have been working on this program, and I finally have it down to just a few problems that I cannot figure out. We were to write everything except the main() function and two header files are given to us to use. The first one sets up an array. We are not supposed to know what goes into the array. The following is a structure I created to implement that array:
typedef struct TotalRecord{
32 | ArrayElement *myarray;
33 | int size;
34 | }ArrayADT;
35 |
36 | typedef ArrayADT *ArrayADTPtr;
I am receiving the following error in one of my functions:
ArrayADTPtr CreateArray(int size)
51 |
52 | {
53 | int i;
54 |
55 | ArrayADTPtr newArray;
56 | ArrayElement elem;
57 |
58 | newArray =(ArrayADTPtr) malloc(sizeof(ArrayADTPtr));
59 | elem = (ArrayElement) malloc(size*sizeof(ArrayElement));
"assignment1.c", line 59.17: 1506-117 (S)Operand must be a scalar type.
I am not sure what the problems is, which operand needs to be scalar, or what this program is getting at. I am very new at this. Please help me if you can. Thank you.
kfarinella