1

I was looking through some UE4 demo codes and found this:

/* Flag to control firing  */
 uint32 bCanFire : 1;

in Pawn.h, my guess is that this is a initialization value for bCanFire so that bCanFire = 1 initially, am I correct?

I've seen colon used in initialization list but not in this context.

legokangpalla
  • 493
  • 3
  • 19

1 Answers1

4

That means that the integer will take the specified number of bits. They are called bitfields. Multiple bitfields put together can save memory but are generally slightly more expensive to access.

Rob L
  • 2,216
  • 12
  • 23