Home c++ The C++ byte

The C++ byte

Author

Date

Category

I’m interested in this data type: the question is, what seems to be found in the source code (strangers), but my compiler swears at

byte a;
  BYTE a;

Answer 1, authority 100%

You have been written quite correctly that there is no such type in C++. And nevertheless, you could have come across it in someone else’s code. For example, from MSDN :

BYTE
A byte (8 bits).
This type is declared in WinDef.h as follows:
typedef unsigned char BYTE;


Answer 2, authority 50%

C++ 17 introduces std :: byte https://en.cppreference.com/w/cpp/types/byte .

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions