Click here to Skip to main content
15,915,160 members
Home / Discussions / C#
   

C#

 
AnswerRe: Executable Pin
Vikram A Punathambekar21-Dec-05 1:19
Vikram A Punathambekar21-Dec-05 1:19 
GeneralRe: Executable Pin
J4amieC21-Dec-05 3:23
J4amieC21-Dec-05 3:23 
GeneralRe: Executable Pin
Vikram A Punathambekar21-Dec-05 16:17
Vikram A Punathambekar21-Dec-05 16:17 
QuestionUser Controls access Page variable Pin
vinyladdict21-Dec-05 0:00
vinyladdict21-Dec-05 0:00 
QuestionGUI Question Pin
HolyGrandFather20-Dec-05 23:04
HolyGrandFather20-Dec-05 23:04 
AnswerRe: GUI Question Pin
WetRivrRat21-Dec-05 6:32
WetRivrRat21-Dec-05 6:32 
QuestionReverse Engineering Added Numbers Pin
redfish3420-Dec-05 22:41
redfish3420-Dec-05 22:41 
AnswerRe: Reverse Engineering Added Numbers Pin
Colin Angus Mackay20-Dec-05 22:49
Colin Angus Mackay20-Dec-05 22:49 
You can perform logical operators to the number you have. For example:
int Wav16bit = 10;
if ((Wav16bit & SF_FORMAT_WAV) != 0)
{
    // It's a WAV file
}
if ((Wav16bit & SF_FORMAT_PCM_16) != 0)
{
    // It's 16 bit
}

NOTE: There is only one ampersand.

What it does is look at the bits in the number and perform a logical and operation. So only where positions where the bits match will it be true

0001 & 0001 = 0001 // Both numbers match
0010 & 0001 = 0000 // Not matching bits
0100 & 0101 = 0100 // Only the second bit matches

There is another useful, similar, operator - the logical or operator and it is represented by a vertical bar | It says that if any bits are on on either side then that bit will be on in the result:

0001 | 0001 = 0001
0010 | 0001 = 0011
0100 | 0011 = 0111

Does this help?


My: Blog | Photos

"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius

-- modified at 5:03 Wednesday 21st December, 2005


GeneralRe: Reverse Engineering Added Numbers Pin
J4amieC20-Dec-05 22:59
J4amieC20-Dec-05 22:59 
GeneralRe: Reverse Engineering Added Numbers Pin
Colin Angus Mackay20-Dec-05 23:04
Colin Angus Mackay20-Dec-05 23:04 
GeneralThanks Pin
redfish3423-Dec-05 1:22
redfish3423-Dec-05 1:22 
QuestionStruct of array Pin
peppepinna20-Dec-05 22:32
peppepinna20-Dec-05 22:32 
AnswerRe: Struct of array Pin
Colin Angus Mackay20-Dec-05 22:41
Colin Angus Mackay20-Dec-05 22:41 
GeneralRe: Struct of array Pin
peppepinna20-Dec-05 22:56
peppepinna20-Dec-05 22:56 
GeneralRe: Struct of array Pin
peppepinna20-Dec-05 23:08
peppepinna20-Dec-05 23:08 
GeneralRe: Struct of array Pin
Colin Angus Mackay20-Dec-05 23:13
Colin Angus Mackay20-Dec-05 23:13 
AnswerRe: Struct of array Pin
Colin Angus Mackay20-Dec-05 23:12
Colin Angus Mackay20-Dec-05 23:12 
GeneralRe: Struct of array Pin
peppepinna20-Dec-05 23:17
peppepinna20-Dec-05 23:17 
QuestionContinuous update of PrintPreviewControl Pin
lclarsen20-Dec-05 21:52
lclarsen20-Dec-05 21:52 
AnswerRe: Continuous update of PrintPreviewControl Pin
tatchung20-Dec-05 22:41
tatchung20-Dec-05 22:41 
GeneralRe: Continuous update of PrintPreviewControl Pin
lclarsen21-Dec-05 0:48
lclarsen21-Dec-05 0:48 
QuestionDraw in application using c# Pin
Mahi.Ragava20-Dec-05 21:28
Mahi.Ragava20-Dec-05 21:28 
AnswerRe: Draw in application using c# Pin
Bassam Saoud21-Dec-05 23:27
Bassam Saoud21-Dec-05 23:27 
GeneralRe: Draw in application using c# Pin
Mahi.Ragava21-Dec-05 23:52
Mahi.Ragava21-Dec-05 23:52 
QuestionCalling AcceptChanges not updating RowStatus Pin
hasansheik20-Dec-05 21:12
hasansheik20-Dec-05 21:12 

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.