Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Pointers and References

by Leudwinus (Scribe)
on Nov 25, 2020 at 17:36 UTC ( [id://11124209]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #include <stdio.h>
    int sum_and_diff (int a, int b, int *res)
    ...
        sum_and_diff (5, b, &diff));
        printf ("The difference of 5 and %d is %d\n", b, diff);
    }
    
  2. or download this
    SCALAR(0x60008a730) --> reference to a scalar
    ARRAY(0x60008a828)  --> reference to an array
    REF(0x600003e80)    --> reference to a reference
    
  3. or download this
    $$x  # dereference reference to scalar (if $x is a scalar)
    @$x  # dereference reference to array (if $x is reference to an array)
    @$$x # dereference reference to reference of an array
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124209]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-23 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found