array and index incremented

  • Thread starter Thread starter AntoninHofmann
  • Start date Start date
A

AntoninHofmann

Guest
int main()
{
unsigned char bb[] = { 1,2 };

int idx = 0;
int result = bb[idx++] + bb[idx];

std::cout << result;
}


I thought, the result should be 3, but it is 2 ?! Why ?

Continue reading...
 
Back
Top