Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
QuestionLooking for help deciphering this code class Pin
turbosupramk313-Jan-12 19:09
turbosupramk313-Jan-12 19:09 
AnswerRe: Looking for help deciphering this code class Pin
Richard MacCutchan13-Jan-12 22:23
mveRichard MacCutchan13-Jan-12 22:23 
GeneralRe: Looking for help deciphering this code class Pin
turbosupramk314-Jan-12 3:28
turbosupramk314-Jan-12 3:28 
GeneralRe: Looking for help deciphering this code class Pin
Richard MacCutchan14-Jan-12 3:41
mveRichard MacCutchan14-Jan-12 3:41 
GeneralRe: Looking for help deciphering this code class Pin
harold aptroot14-Jan-12 4:34
harold aptroot14-Jan-12 4:34 
AnswerRe: Looking for help deciphering this code class Pin
OriginalGriff14-Jan-12 0:23
mveOriginalGriff14-Jan-12 0:23 
GeneralRe: Looking for help deciphering this code class Pin
turbosupramk314-Jan-12 3:27
turbosupramk314-Jan-12 3:27 
GeneralRe: Looking for help deciphering this code class Pin
OriginalGriff14-Jan-12 3:37
mveOriginalGriff14-Jan-12 3:37 
>> and ? are standard bits of C#: you can find out about them quite easily if you google for C# Operators, which will take you to MSDN[^] - a good place to start if there is any C# or .NET thing you don't understand.

">>" is a SHIFT operator. It moves a value one bit to the right, effectively dividing it by two. So 20 hex would become 10 hex, 10 hex would become 08 hex, and so forth. The bottom bit is discarded.

"?" is a short hand for an if...then...else... with a value returned. The condition is to the left of the "?", the true value is to the right, and the false value is to the right of the ":". So:
C#
version += (byte)(ReceiveBit(false, 100) ? 128 : 0);
could be written as:
C#
if (ReceiveBit(false, 100))
   {
   version += (byte) 128;
   }
else
   {
   version += (byte) 0;
   }


[edit]Typos: I hate this keyboard - OriginalGriff[/edit]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

GeneralRe: Looking for help deciphering this code class Pin
turbosupramk314-Jan-12 3:41
turbosupramk314-Jan-12 3:41 
GeneralRe: Looking for help deciphering this code class Pin
OriginalGriff14-Jan-12 3:53
mveOriginalGriff14-Jan-12 3:53 
GeneralRe: Looking for help deciphering this code class Pin
harold aptroot14-Jan-12 4:47
harold aptroot14-Jan-12 4:47 
GeneralRe: Looking for help deciphering this code class Pin
OriginalGriff14-Jan-12 5:03
mveOriginalGriff14-Jan-12 5:03 
GeneralRe: Looking for help deciphering this code class Pin
harold aptroot14-Jan-12 5:22
harold aptroot14-Jan-12 5:22 
GeneralRe: Looking for help deciphering this code class Pin
OriginalGriff14-Jan-12 5:31
mveOriginalGriff14-Jan-12 5:31 
GeneralRe: Looking for help deciphering this code class Pin
turbosupramk314-Jan-12 8:18
turbosupramk314-Jan-12 8:18 
GeneralRe: Looking for help deciphering this code class Pin
harold aptroot14-Jan-12 9:34
harold aptroot14-Jan-12 9:34 
GeneralRe: Looking for help deciphering this code class Pin
turbosupramk315-Jan-12 5:23
turbosupramk315-Jan-12 5:23 
AnswerRe: Looking for help deciphering this code class Pin
BobJanova15-Jan-12 23:11
BobJanova15-Jan-12 23:11 
QuestionOnline users Pin
RichardKly13-Jan-12 6:37
RichardKly13-Jan-12 6:37 
AnswerRe: Online users Pin
PIEBALDconsult13-Jan-12 6:47
mvePIEBALDconsult13-Jan-12 6:47 
AnswerRe: Online users Pin
Qendro13-Jan-12 6:54
Qendro13-Jan-12 6:54 
Questionhwo to sort observabale collection? Pin
SRKSHOME13-Jan-12 3:08
SRKSHOME13-Jan-12 3:08 
AnswerRe: hwo to sort observabale collection? PinPopular
Abhinav S13-Jan-12 3:19
Abhinav S13-Jan-12 3:19 
AnswerRe: hwo to sort observabale collection? Pin
DaveyM6913-Jan-12 4:53
professionalDaveyM6913-Jan-12 4:53 
Questionhow do u execute this Pin
kkcarthieckk13-Jan-12 2:24
kkcarthieckk13-Jan-12 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.