C# Programming Tutorials: Beginners 10 Binary and Bitwise Operators

preview_player
Показать описание
Part of the series of tutorials on programming C# for beginners

Takes a look at binary and bitwise operators, where and how they are used

Рекомендации по теме
Комментарии
Автор

Dude binary was foreign to me until 10 minutes into your video. Thank you so much. Subbereddd

mattshu
Автор

Thanks for this.

I started watching for those four basic operators, but the refresher on bit-shifting and the explanation of the flags/masking turned out to be exactly what I realized I also wanted to know once I got to the halfway point.

JediMB
Автор

I've been working on level design and special effects since 2004 and started hardcoding in 2019. Two years I've tried to understand the bitwise operators. Ten minutes into your video - boom. We've done these operations a lot and never had a good explanation of how it actually works in detail. I will provide this video to some friends who struggle with it as well :D Thanks for saving me and my soon-to-come grades. :D

wootdafuq
Автор

Hi, Luke! I know this is old video, but I also know, that you answer most comments typically.
My colleague recently gave me this awesome example of bitwise logic (he mentioned, that it was found out by some famous programmer (I forgot his name), who also happenes to be a good mathematician.

So:

value1 ^= value2 ^= value1 ^= value2.

This swaps variables values without having any temp third variables to store the value. Value can by of any type, as he said (if I remember correctly).

loam
Автор

I have struggled to fully understand bitwise operations for years. This short video helped me more than any other resource I’ve used before now. THANK YOU!!

RogerCorley
Автор

Thank you for this. Been doing .NET for 10 years and never taken the time to learn this.

xylexrayne
Автор

2:19 Yes, you can create a bit, the way to manipulate binary in C# is using this: var a = 0b0100; //number 8 in decimal in this case. So yes, the way is starting with "0b" for binary representation and "0x" for hexadecimal

slychief
Автор

For rookies following along like me, this is using the Console App template in VS.

huckleberrylinn
Автор

When using the windows calculator to do a bitwise you have to press the Lsh or Rsh button followed by the amount of shifts you want to perform.

primev_x
Автор

Thankyou, someone was using these alien like terms in their code and I ended up here in this video and now I understand them :)

valkyrienyanko
Автор

Why are you always using var and not for example int? My teacher and many ppl on stackoverflow told me, using var in C# is not recommendet, you should always try to avoid var?

escribe
Автор

A very well repetition of scool education. Thanks for this fine explanations.

WernerUllrich
Автор

Explanation is brilliant... thank you :)

jacoblom
Автор

Sweet video. Thanks for the clear explanations and code examples. Good job, you get my sub.

Liquiddeath
Автор

Great tutorials, I'm enjoying them immensely.

I'm coming from VB (I know!!!), VB.Net, VBA, ASP.net background, although I have also written a few, fairly rushed C# programs, I'm watching these more for good programming practice and to quickly fill in any big gaps in my knowledge - this tutorial being one such example.

If there is one thing I will take from these tutorials, it is the proper documentation of code, I have been shamefully neglectful of this in the past :(

I have a couple of questions, if you don't mind, do you have any plans to cover MVC and where are you from - my guess is South Manchester :)

Anyway, thanks again for the tutorials - superb stuff.

killingTime-ol
Автор

To avoid the annoying byte casting force the enum to extend byte!

arrditaros
Автор

this was really good at explaining and showing the use out of it

nightfall
Автор

A truly great content! Thank you for having made this video!

andreme
Автор

I have a serious question.
Why does every youtube who shows code in C# have VS in LIGHT MODE.

xylexrayne
Автор

Is there a low-cost way to ignore every other byte? I have an image where I only care about the first byte, because I want to truncate a 12-bit image to 8-bit. Basically I want to reduce the size of the memory buffer by half by taking only the most significant bytes.

Chiramisudo