Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Pointers and References

by Leudwinus (Beadle)
on Nov 25, 2020 at 17:36 UTC ( #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
Node Status?
node history
Node Type: note [id://11124209]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2021-06-13 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (54 votes). Check out past polls.

    Notices?