can indexed array get memory allocation??

Apr 12, 2015 at 6:47am
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 Apr 12, 2015 at 7:45am
Apr 12, 2015 at 5:52pm
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.