0

Given struct S_DEMO, and main that looks like this:

void main()
{
    int buff[5] = { 0, 1, 2, 3, 4, 5}; // Size doesn't really matter here for the example
    S_DEMO* dem_p;
    dem_p = (S_DEMO*)buff;
    dem_p = (S_DEMO*)&buff;
}

Then the address of demp_p will be the same with dem_p = (S_DEMO*)buff; and dem_p = (S_DEMO*)&buff;, right? Is that because (S_DEMO*)&buff considered to be the first element of the array, even that the [] brackets aren't used ((S_DEMO*)&buff[0])?

Thanks.

IntToThe
  • 49
  • 6

0 Answers0