cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
can indexed array get memory allocation
can indexed array get memory allocation??
Apr 12, 2015 at 6:47am
Apr 12, 2015 at 6:47am UTC
nastaran mhy
(1)
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 7:45am UTC
Apr 12, 2015 at 5:52pm
Apr 12, 2015 at 5:52pm UTC
Disch
(13742)
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
int
s, 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.