Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: creating 2D arrays

by PrakashK (Pilgrim)
on Jul 24, 2001 at 21:18 UTC ( #99416=note: print w/replies, xml ) Need Help??

in reply to creating 2D arrays

As has already been explained by others, a reference must be used in place of an array itself.

I'd like to add just one thing. For performance reasons, i'd rather change the sub mult to return the array reference rather than the array itself. Also, pass an array reference as the second param to mult instead of an array.

sub mult { my ($a, $b) = @_; # dereference the array, process it and create a new array .... return \@c; } ## Assuming that the array @b is a 2D array too for $i (0..$N){ push @results, mult($a, $b[$i]); }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://99416]
[stevieb]: can anyone recommend a good IDE for C programming that has *proper* vim plugin support? I've tried Eclipse, Netbeans etc and just can't get anything to work properly on Linux. I'm open to paying, but not on some monthly/yearly plan (just a one-off cost)
[stevieb]: I'd go with CLion as it's very similar to what I use already (intelliJ for Perl, Pycharm for Python), but it's a recurring fee every year

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-01-18 19:14 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (163 votes). Check out past polls.