Difference between [square brackets] and *asterisk

后端 未结 5 2103
遇见更好的自我
遇见更好的自我 2020-11-27 04:03

If you write a C++ function like

void readEmStar( int *arrayOfInt )
{
}

vs a C++ function like:

void readEmSquare( int arrayOfInt[] )
{
}
         


        
5条回答
  •  执笔经年
    2020-11-27 04:14

    The two expressions are equivalent. They each evaluate to the address of the first element of the array arrayOfInt.

提交回复
热议问题