![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Main
Diff: main.cpp
- Revision:
- 1:a3d6a365dc15
- Parent:
- 0:7925301ed8e4
- Child:
- 2:47d9c6c7eb9e
--- a/main.cpp Mon Jan 13 17:10:21 2020 +0000 +++ b/main.cpp Mon Jan 13 17:12:35 2020 +0000 @@ -17,10 +17,11 @@ int anzahl, anz; uint8_t value = INIT; - - - - - - -} \ No newline at end of file + +} + +int modifyBit (int x, uint8_t position, bool State){ + int mask = 1 << position; + int state = int(State); + return (x & ~mask) | ((state << position) & mask); + } \ No newline at end of file