Click here to Skip to main content
15,881,600 members
Home / Discussions / C#
   

C#

 
GeneralRe: SAPI Training From Wav File Pin
aidesigner30-Nov-11 17:21
aidesigner30-Nov-11 17:21 
QuestionColor dropdown for new Toolstrip [modified] Pin
Jim Crafton18-Dec-09 4:08
Jim Crafton18-Dec-09 4:08 
QuestionShift operator [modified] Pin
thungphan18-Dec-09 3:23
thungphan18-Dec-09 3:23 
AnswerRe: Shift operator Pin
thungphan18-Dec-09 4:30
thungphan18-Dec-09 4:30 
GeneralRe: Shift operator Pin
Rob Philpott18-Dec-09 4:42
Rob Philpott18-Dec-09 4:42 
GeneralRe: Shift operator Pin
thungphan18-Dec-09 4:54
thungphan18-Dec-09 4:54 
AnswerRe: Shift operator Pin
harold aptroot18-Dec-09 4:55
harold aptroot18-Dec-09 4:55 
AnswerRe: Shift operator Pin
Luc Pattyn18-Dec-09 5:09
sitebuilderLuc Pattyn18-Dec-09 5:09 
Hi,

you probably are confusing two things:

1.
assuming b is unsigned or positive, b<<24 is an attempt to generate a larger number, in fact it is equivalent to a multiplication by 2^24 (which might overflow, i.e. loose bits shifted out at the high end, and therefore could result in zero). Anyway, it is a numeric or mathematical operation. So is 5>>24 which will result in zero since all bits get lost at the low end, as others have said already.

2.
multi-byte variables (such as int) are stored in memory in one of two ways:
"big endian" = the most significant byte comes first (i.e. at the lowest address)
"little endian" = the least significant byte comes first.
Intel processors (and some others too) implement the little-endian convention. Other processor families, and some networks and protocols use big-endian (e.g. the administrative information used on Ehternet networks).


Both issues are unrelated. If you want to operate on values/numbers, look at (1). If you want to operate on memory bytes, don't look at (1), use the BitConverter class instead (or a fake "union" construction, with a struct and explicit offsets).

Smile | :)

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


modified on Friday, December 18, 2009 11:44 AM

AnswerRe: Shift operator Pin
thungphan18-Dec-09 17:05
thungphan18-Dec-09 17:05 
GeneralRe: Shift operator Pin
harold aptroot19-Dec-09 3:29
harold aptroot19-Dec-09 3:29 
QuestionTwo ListViews Pin
Tagamoga18-Dec-09 2:38
Tagamoga18-Dec-09 2:38 
AnswerRe: Two ListViews Pin
benjymous18-Dec-09 3:14
benjymous18-Dec-09 3:14 
GeneralRe: Two ListViews Pin
Tagamoga18-Dec-09 3:29
Tagamoga18-Dec-09 3:29 
Questionzedgraph Pin
jashimu18-Dec-09 2:16
jashimu18-Dec-09 2:16 
AnswerMessage Closed Pin
18-Dec-09 2:50
stancrm18-Dec-09 2:50 
GeneralRe: zedgraph Pin
jashimu18-Dec-09 4:09
jashimu18-Dec-09 4:09 
QuestionHide database file from user Pin
NarendraSinghJTV18-Dec-09 1:53
NarendraSinghJTV18-Dec-09 1:53 
AnswerRe: Hide database file from user Pin
Ashfield18-Dec-09 2:02
Ashfield18-Dec-09 2:02 
GeneralRe: Hide database file from user Pin
NarendraSinghJTV18-Dec-09 2:33
NarendraSinghJTV18-Dec-09 2:33 
GeneralRe: Hide database file from user Pin
Saksida Bojan18-Dec-09 3:57
Saksida Bojan18-Dec-09 3:57 
GeneralRe: Hide database file from user Pin
NarendraSinghJTV18-Dec-09 17:51
NarendraSinghJTV18-Dec-09 17:51 
GeneralRe: Hide database file from user Pin
Saksida Bojan18-Dec-09 20:42
Saksida Bojan18-Dec-09 20:42 
GeneralRe: Hide database file from user Pin
Ashfield18-Dec-09 8:53
Ashfield18-Dec-09 8:53 
GeneralRe: Hide database file from user Pin
NarendraSinghJTV18-Dec-09 17:50
NarendraSinghJTV18-Dec-09 17:50 
GeneralRe: Hide database file from user Pin
Ashfield18-Dec-09 20:25
Ashfield18-Dec-09 20:25 

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.