C pointer : array variable

后端 未结 7 510
盖世英雄少女心
盖世英雄少女心 2021-01-20 18:09

I read this in my book (and many sources on the internet):

The array variable points to the first element in the array.

7条回答
  •  旧时难觅i
    2021-01-20 18:53

    char myChar = 'A'
    char msg[] = 'ABCDEFGH'
    

    When you type myChar you get value. But with msg you get pointer to first char(for values you have to use msg[x])

    msg = &msg[0]
    

    This can help you to understand, I think.

提交回复
热议问题