Questions about array pointers in go language

when learning go pointers, we think that the pointer variable stores the value of the memory address, and the * operator can get the stored value of the memory

.

then when you join the pointer to the array ( array pointer ), you find that you can manipulate the array directly with the pointer instead of *

ordinary variable pointer operation

package main

impotr "fmt"

func main(){
    pArr := [3]int{12,2,9}
    pArr[0] = 16
    pAdd := &pArr
    (*pAdd)[0] = 444
    
    fmt.Printf("pArr[0] %v\n",pArr[0])
    fmt.Printf("pAdd[0] %v\n",pAdd[0])
    fmt.Printf("pAdd %v\n",pAdd)
    fmt.Printf("pArr  %v\n",pArr)
    fmt.Printf("pAdd  %v\n",*pAdd)
    fmt.Printf("pArr[0]  %v\n",&pArr[0])
    fmt.Printf("pAdd[0]  %v\n",&pAdd[0])
    fmt.Printf("(*pAdd)[0]  %v\n",&(*pAdd)[0])
    
    /*output
        pArr[0] 444
        pAdd[0] 444
        pAdd &[444 2 9]
        pArr  [444 2 9]
        pAdd  [444 2 9]
        pArr[0]  0xc04200c2e0
        pAdd[0]  0xc04200c2e0
        (*pAdd)[0]  0xc04200c2e0
    */
}

pay attention to the above,

directly manipulate the array pArr [0] = 16 I can understand
find the array through the pointer and then manipulate the array (* pAdd) [0] = 16 I can also understand

but ~!

what is the operation that can operate to the original array directly through the pointer? pAdd [0] = 16 this I don"t quite understand.
in this way, the operation is literally a pointer, but the original array is also changed. After output, it is found that everyone points to the same address value

. Address of
pArr [0] 0xc04200c2e0
address of pAdd [0] 0xc04200c2e0
(* pAdd) [0] address 0xc04200c2e0

ps: subject does not have the foundation of c, which is a pointer language. I hope you can understand

. Finally, I would like to ask, how to understand the situation of manipulating arrays directly with pointers? < / H1 >
Apr.01,2021

actually the compiler transforms you, improves fault tolerance, and prevents unnecessary thinking


I have found the answer. In fact, pAdd [0] is the abbreviation of (* pAdd) [0]. That's what the official document says

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4276b-449cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4276b-449cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?