C
C
chaikovskyiii2021-11-22 15:58:53
C++ / C#
chaikovskyiii, 2021-11-22 15:58:53

How to change the digits of a two-byte number (C++)?

Help me plss.
There is an integer two-byte number
We need to change its 0th, 5th and 11th digit to 0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-11-22
@wataru

You need to do a bitwise AND with a mask where there are 0 in the bits you need (and 1 in the rest). The mask can be specified directly with a binary or hexadecimal constant.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question