Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MoveFileEx fails Pin
Nelek4-Nov-07 21:59
protectorNelek4-Nov-07 21:59 
Questionplzzz Hellppp meeeee exercise for tomorroww Pin
eerrikkaa4-Nov-07 2:46
eerrikkaa4-Nov-07 2:46 
AnswerRe: plzzz Hellppp meeeee exercise for tomorroww Pin
David Crow4-Nov-07 2:48
David Crow4-Nov-07 2:48 
AnswerRe: plzzz Hellppp meeeee exercise for tomorroww Pin
Hamid_RT4-Nov-07 3:07
Hamid_RT4-Nov-07 3:07 
AnswerRe: plzzz Hellppp meeeee exercise for tomorroww Pin
Stephen Hewitt4-Nov-07 3:19
Stephen Hewitt4-Nov-07 3:19 
AnswerRe: plzzz Hellppp meeeee exercise for tomorroww Pin
ThatsAlok4-Nov-07 18:54
ThatsAlok4-Nov-07 18:54 
QuestionSMTP mail server Pin
bigdenny2004-Nov-07 1:04
bigdenny2004-Nov-07 1:04 
Questionwhich way is more efficient to check bit value Pin
George_George4-Nov-07 1:02
George_George4-Nov-07 1:02 
Hello everyone,


I have a long array (char*) and I need to check which bit is the first bit whose value is 1.

I have two ways to implement,

1. Iterate each byte, then iterate each bit in each byte one by one;
2. Iterate each byte, and check whether the value of the byte itself is non-zero, if yes, then iterate each bit in the byte to find which bit is the first bit which is set to 1, or else skip this byte and continue to iterate next byte.

I think (2) is always faster, right? But I do not know why (2) is faster since it is just my personal estimation without any concrete basis analysis.


thanks in advance,
George
AnswerRe: which way is more efficient to check bit value Pin
David Crow4-Nov-07 2:48
David Crow4-Nov-07 2:48 
GeneralRe: which way is more efficient to check bit value Pin
George_George4-Nov-07 18:15
George_George4-Nov-07 18:15 
AnswerRe: which way is more efficient to check bit value Pin
Chris Losinger4-Nov-07 5:47
professionalChris Losinger4-Nov-07 5:47 
GeneralRe: which way is more efficient to check bit value Pin
George_George4-Nov-07 18:26
George_George4-Nov-07 18:26 
GeneralRe: which way is more efficient to check bit value Pin
Chris Losinger5-Nov-07 0:58
professionalChris Losinger5-Nov-07 0:58 
GeneralRe: which way is more efficient to check bit value Pin
George_George5-Nov-07 1:13
George_George5-Nov-07 1:13 
GeneralRe: which way is more efficient to check bit value Pin
David Crow5-Nov-07 3:43
David Crow5-Nov-07 3:43 
GeneralRe: which way is more efficient to check bit value Pin
George_George5-Nov-07 18:41
George_George5-Nov-07 18:41 
QuestionCreate a file, containing folder contents Pin
TheRamon3-Nov-07 23:38
TheRamon3-Nov-07 23:38 
AnswerRe: Create a file, containing folder contents Pin
Nelek4-Nov-07 21:51
protectorNelek4-Nov-07 21:51 
Questionlocal system account Pin
ginjikun3-Nov-07 22:59
ginjikun3-Nov-07 22:59 
QuestionNetwork Monitor Pin
AhmedOsamaMoh3-Nov-07 21:46
AhmedOsamaMoh3-Nov-07 21:46 
QuestionExport string from Dll Pin
Max++3-Nov-07 21:02
Max++3-Nov-07 21:02 
QuestionTracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr3-Nov-07 15:39
Larry Mills Sr3-Nov-07 15:39 
AnswerRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Nelek4-Nov-07 21:41
protectorNelek4-Nov-07 21:41 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr5-Nov-07 5:57
Larry Mills Sr5-Nov-07 5:57 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls [modified] Pin
Nelek5-Nov-07 20:30
protectorNelek5-Nov-07 20:30 

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.