C++ Bit Fields

  Рет қаралды 15,597

Creel

Creel

Күн бұрын

Пікірлер: 26
@SirRoundPotato
@SirRoundPotato 9 жыл бұрын
Great stuff. Your channel is underrated.
@kudoamv
@kudoamv 7 жыл бұрын
Why do you say it is underrated ?
@Andrew-vf6fg
@Andrew-vf6fg 2 жыл бұрын
Thank you for this funny yet detailed video.
@helioimperium
@helioimperium 9 жыл бұрын
'' Gnu compiler would complain: hey what you doing bro '' that really made my day
@wuza8405
@wuza8405 5 жыл бұрын
I don't really know why youtube algorithm gives me videos with knowledge, that I need right now, thank you very much, it's essential with packet forming and even reading binary files, beautiful!
@nextlifeonearth
@nextlifeonearth 3 жыл бұрын
Instead of using -1, I prefer to just invert the 0, to be more specific. ie: uint8_t data = ~0U; And remember; signed binary arithmetic is undefined behaviour.
@Morimea
@Morimea 2 жыл бұрын
21:17 - wow I was looking for something like that in C++, new for me (float bit hacks... wow!) great video with lots of useful information!
@windcarve8265
@windcarve8265 5 жыл бұрын
Neat little things to use with bit fields! The problem for me was coming up with some use for them! Thanks for demonstrating some of the uses :) !
@calmsh0t
@calmsh0t 5 жыл бұрын
thats a great demonstration, thanks!
@AegirAexx
@AegirAexx 7 жыл бұрын
God dammit.. If I would've known about Bit Fields when I did my Computer Architecture course things would've been much easier. I was always cursing that I was unable to try out bit manipulation on odd number bits problems. This is great stuff. Your channel rocks!
@BarnardClangdeggin
@BarnardClangdeggin 8 жыл бұрын
Nice tutorial. Good job.
@ColinBroderickMaths
@ColinBroderickMaths 3 жыл бұрын
You said several times that other compilers might do it differently, but do you have any examples of compilers doing it differently?
@elliott8175
@elliott8175 3 жыл бұрын
Sadly the use of *union* for type-punning, although supported by most compilers, isn't defined by the standard (it *_is_* for *C* , but not *C++* ). Have a look at stackoverflow's _"Accessing inactive union member and undefined behavior?"_
@konstantinrebrov675
@konstantinrebrov675 6 жыл бұрын
Amazing!
@AfdhalAtiffTan
@AfdhalAtiffTan 7 жыл бұрын
Thank you!
@noxatra6030
@noxatra6030 3 жыл бұрын
nice
@shritishaw7510
@shritishaw7510 3 жыл бұрын
I didn't get the fact:- you wrote unsigned char a:3,b:3; and then in the main() you assigned bf.a = int type and so goes for bf.b. And then you told that it will support all kinds of arithmetic operations. Well, you're right. but data type of a and b is char and we are assigning int value to both of them in the main(). And to my surprise, the compiler doesn't show any error, instead, it displays the solution. HOW IS THIS HAPPENING?
@privateerburrows
@privateerburrows 3 жыл бұрын
Automatic conversion of int to char. Just like you can write float f = 4.2, instead of float f = 4.2f if you're sloppy. I guess they could have made a special notation for bitfield constants, like 7:u3 or 11:i4 that are checked to make sense at compile time... =9:i3; //BOOM!
C++ Unions
32:39
Creel
Рет қаралды 9 М.
C++ Function Templates
36:02
Creel
Рет қаралды 13 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Bit Fields in C. What are they, and how do I use them?
13:26
Jacob Sorber
Рет қаралды 85 М.
Bit Fields In C & C++
20:36
CppNuts
Рет қаралды 22 М.
POINTERS in C++
16:59
The Cherno
Рет қаралды 1 МЛН
What Are Pointers? (C++)
41:55
javidx9
Рет қаралды 565 М.
C++ 11: Range Based For Loops
18:50
Creel
Рет қаралды 4,8 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 759 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 334 М.
I Designed My Own 16-bit CPU
15:46
AstroSam
Рет қаралды 2,1 МЛН
Forbidden C++
33:07
javidx9
Рет қаралды 1 МЛН