can indexed array get memory allocation??

hi all;
for example write[20];
write[0]=12;
.
.
long double *epc=(long double*)malloc(13*sizeof(char));
write[3]=*epc;
write[16]=20;
.
.

is it true??
Last edited on
Your question is a little unclear, and I'm not sure I'm correctly understanding it.


Each element in the array has a fixed type. That type determines what it can be (and really, it is the only thing it can be).

For example:

 
int foo[20];


Since 'foo' is an array of ints, this means that each element in the array must be an int. It cannot be anything else.

So you couldn't, for example, make one of the elements another array.
Topic archived. No new replies allowed.