Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for s2 (0.31 sec)

  1. doc/go_spec.html

    array with the operand.
    </p>
    
    <pre>
    var a [10]int
    s1 := a[3:7]   // underlying array of s1 is array a; &amp;s1[2] == &amp;a[5]
    s2 := s1[1:4]  // underlying array of s2 is underlying array of s1 which is array a; &amp;s2[1] == &amp;a[5]
    s2[1] = 42     // s2[1] == s1[2] == a[5] == 42; they all refer to the same underlying array element
    
    var s []int
    s3 := s[:0]    // s3 == nil
    </pre>
    
    
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 00:39:16 GMT 2024
    - 279.6K bytes
    - Viewed (0)
Back to top