Bol to 1 or 0 by indicator



  • Like, true Is it 1 using the indicators? And why exactly 1 instead of the other number as in the case of a variable d?

    unsafe
    {
       bool a = true;
       bool* b = &a;
    

    int c = (int*)b; //указатель на число 1, почему?
    int d = (int)b; //какое-то другое число, почему?
    }



  • It's a different number because address The variable is intact. In the 32-design system, it's gonna look like, 0x124a53b0

    Inside, logical variables are 0 and 1, which you see in the first case.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2