realyst said:
Thanks again for all the feedback
I'm actually now looking at how pointers work and am loving the possibilities! (does that make me a sick man?)
Well, you are already familiar with pointers in Perl, although they are called references there (perldoc perlref). A straightforward (naive) translation from a hash reference in Perl
my %h = (a=>1, b=>2);
my $p = \%h;
printf "%d\n", $p->{a};
to a struct pointer in C would be:
struct {int a; int b;} h = {1, 2}, *p = &h;
printf("%d\n", p->a);
The dereference operator (->) is even the same.
Unless of course you mean with possibilities (potentially unsafe) type casts and dangling pointers :lol:
I didn't think references in Perl could be used to cross scope or some of the other tricks I've seen so far.
But then again I'll admit that perl references were barely touched(I was mostly a php guy) as the syntax was far too funky and the documentation far too horrific.
Though I did touch them to simulate multidimensional arrays(why I'd need to 'simulate' something that should be inherent is topic for another flame war
)