S
sunny_rao
Is it possible to change the size of an array dynamically at runtime ?
sunny_rao said:Is it possible to change the size of an array dynamically at runtime ?
?sunny_rao said:Is it possible to change the size of an array dynamically at runtime
Is it possible to change the size of an array dynamically at runtime ?
sunny_rao said:Is it possible to change the size of an array dynamically at runtime ?
Null_Ptr_72 said:As far as Arrays[ ], ISO forbids for us to change the size at
run-time, depending on your implementation (i.e Borland C++ builder 6)
will flag an error, while gcc Won't. The whole idea behind this is to
help us not "write post fence" data in memory.
?Is it possible to change the size of an array dynamically at runtime
Is it possible to change the size of an array dynamically at runtime ?
Null_Ptr_72 said:Dear Thompson,
"but I'd expect any compiler to reject that."
There are many tricks we can play to go on doing illegal operations
at compile time! "Implementation" however can determine how limited we
are in "being" slick &&|| Tricky.
Try your code "sizeof(array_obj) *= 2" on gcc, and try it on a
different compiler, see the results. One will accept it "because its
tricky" while the other won't "because its expensive!"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.