467,081 Members | 1,275 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,081 developers. It's quick & easy.

How to dynamically initialize an array

I would like to have an array, its size will be passed as an argument in runtime. And I want to intialize it. How should I do? Thanks.
Oct 21 '08 #1
  • viewed: 3226
Share:
2 Replies
numberwhun
Expert Mod 2GB
Ok, so what have you tried thus far to do this? This sounds distinctly like school work. If it is, then you need to know that it is against this sites posting guidelines for you to post your homework and expect an answer.

What you are asking is rather fundamental and a quick Google search will help you do what you are asking. Any good "perl arrays" tutorial should explain these basic concepts.

Regards,

Jeff
Oct 21 '08 #2
KevinADC
Expert 2GB
I would like to have an array, its size will be passed as an argument in runtime. And I want to intialize it. How should I do? Thanks.
You don't have to allocate memory/buckets to arrays in perl if thats what you are thinking. Perl dynamically adds more buckets as needed and when needed. There might be special reasons to allocate some memory to an array before actually adding data into the array, but I don't know what those reasons might be.
Oct 21 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by SamMan | last post: by
3 posts views Thread by kaiwing18@hotmail.com | last post: by
10 posts views Thread by junky_fellow@yahoo.co.in | last post: by
4 posts views Thread by pauld | last post: by
1 post views Thread by Richard Harter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.