R
Ronny Mandal
Assume that you want to store n records in an array, and that the array can
hold all n elements, that is, it is declared int a[n].
And suddenlny in run-time, I need to store n+m items. Why cannot this be
done:
a[0] = e(0)
a[1] = e(1)
...
...
a[n] = e(n)
where e(i) is the i-th element
*(a+ (n+1) ) = e(the 1st element after n)
...
...
*(a+ (n+1) ) = e(the m-th element after n)
On the ocntrary, if I allocate an array with 0 elements a[0], C will let me
fill in approx 5 more values.
Is there a way to make the "index-table" of an array grow?
--
Thanks
Ronny Mandal
This e-mail and any attachment are confidential and may be privileged or
otherwise protected from disclosure. It is solely intended for the person(s)
named above. If you are not the intended recipient, any reading, use,
disclosure, copying or distribution of all or parts of this e-mail or
associated attachments is strictly prohibited. If you are not an intended
recipient, please notify the sender immediately by replying to this message
or by telephone and delete this e-mail and any attachments permanently from
your system.
hold all n elements, that is, it is declared int a[n].
And suddenlny in run-time, I need to store n+m items. Why cannot this be
done:
a[0] = e(0)
a[1] = e(1)
...
...
a[n] = e(n)
where e(i) is the i-th element
*(a+ (n+1) ) = e(the 1st element after n)
...
...
*(a+ (n+1) ) = e(the m-th element after n)
On the ocntrary, if I allocate an array with 0 elements a[0], C will let me
fill in approx 5 more values.
Is there a way to make the "index-table" of an array grow?
--
Thanks
Ronny Mandal
This e-mail and any attachment are confidential and may be privileged or
otherwise protected from disclosure. It is solely intended for the person(s)
named above. If you are not the intended recipient, any reading, use,
disclosure, copying or distribution of all or parts of this e-mail or
associated attachments is strictly prohibited. If you are not an intended
recipient, please notify the sender immediately by replying to this message
or by telephone and delete this e-mail and any attachments permanently from
your system.