Click here to Skip to main content
15,917,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
toxcct20-Mar-06 6:17
toxcct20-Mar-06 6:17 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 6:21
Link260020-Mar-06 6:21 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Michael Dunn20-Mar-06 7:59
sitebuilderMichael Dunn20-Mar-06 7:59 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Stephen Hewitt20-Mar-06 11:44
Stephen Hewitt20-Mar-06 11:44 
QuestionBit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 5:06
Iain Clarke, Warrior Programmer20-Mar-06 5:06 
AnswerRe: Bit Fields, and sub field size. Pin
Bob Flynn20-Mar-06 8:21
Bob Flynn20-Mar-06 8:21 
GeneralRe: Bit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 21:40
Iain Clarke, Warrior Programmer20-Mar-06 21:40 
GeneralRe: Bit Fields, and sub field size. Pin
Bob Flynn21-Mar-06 3:05
Bob Flynn21-Mar-06 3:05 
OK, I see what you are going for.

I think what you have will work just fine. Perhaps instead of a log2 function you may find that simply finding the non zero bit by counting will be a faster operation.


i = 0;<br />
 while ((i < 32) && ((src & 0x80000000) == 0))<br />
 {<br />
       src = src << 1;<br />
       ++i;<br />
 }


This will tell you how many leading zeros are in your word, therefore providing the location of the first non-zero value.
Questionassertion errors Pin
theprinc20-Mar-06 4:52
theprinc20-Mar-06 4:52 
AnswerRe: assertion errors Pin
PJ Arends20-Mar-06 5:05
professionalPJ Arends20-Mar-06 5:05 
GeneralRe: assertion errors Pin
theprinc20-Mar-06 5:22
theprinc20-Mar-06 5:22 
GeneralRe: assertion errors Pin
PJ Arends21-Mar-06 15:56
professionalPJ Arends21-Mar-06 15:56 
Questionin/out in visual c++ Pin
a_yosef20-Mar-06 4:45
a_yosef20-Mar-06 4:45 
AnswerRe: in/out in visual c++ Pin
PJ Arends20-Mar-06 5:10
professionalPJ Arends20-Mar-06 5:10 
Questionmade by Borland Pin
militiaware20-Mar-06 4:30
militiaware20-Mar-06 4:30 
AnswerRe: made by Borland Pin
toxcct20-Mar-06 4:45
toxcct20-Mar-06 4:45 
QuestionCall another exe Programatically Pin
HNGuruPrasad20-Mar-06 4:28
HNGuruPrasad20-Mar-06 4:28 
AnswerRe: Call another exe Programatically Pin
Michael Dunn20-Mar-06 8:01
sitebuilderMichael Dunn20-Mar-06 8:01 
Questionostringstream: special characters "/" or "?" ? Pin
Sebastian Schneider20-Mar-06 4:07
Sebastian Schneider20-Mar-06 4:07 
AnswerRe: ostringstream: special characters &quot;/&quot; or &quot;?&quot; ? Pin
PJ Arends20-Mar-06 4:44
professionalPJ Arends20-Mar-06 4:44 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
toxcct20-Mar-06 4:47
toxcct20-Mar-06 4:47 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
PJ Arends20-Mar-06 4:54
professionalPJ Arends20-Mar-06 4:54 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
Sebastian Schneider21-Mar-06 0:35
Sebastian Schneider21-Mar-06 0:35 
QuestionInstantiating classes within classes Pin
kialmur20-Mar-06 4:02
kialmur20-Mar-06 4:02 
AnswerRe: Instantiating classes within classes Pin
Maximilien20-Mar-06 4:23
Maximilien20-Mar-06 4:23 

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.