flashburn
flashburn

Reputation: 4528

what is C++ bool myVar : 1?

I'm looking at this file. The code looks like the following

bool isVRegCycle : 1;

The only time I've seen something like this before is in C in structs when bitfields are used. How do I interpret this in C++?

Any help is appreciated.

Upvotes: 0

Views: 81

Answers (1)

Cheers and hth. - Alf
Cheers and hth. - Alf

Reputation: 145419

It's the same in C++, a bit-field.

C++ has nearly all of C as a subset.

The difference are however enough that it's best to treat them as two different languages.

Upvotes: 1

Related Questions