Click here to Skip to main content
15,887,585 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Having trouble converting Java Code to C++ Pin
David Crow20-Apr-09 16:51
David Crow20-Apr-09 16:51 
QuestionC++ Directory Functions Pin
gamefreak229120-Apr-09 15:37
gamefreak229120-Apr-09 15:37 
AnswerRe: C++ Directory Functions [modified] Pin
Joe Woodbury20-Apr-09 16:33
professionalJoe Woodbury20-Apr-09 16:33 
GeneralRe: C++ Directory Functions Pin
gamefreak229120-Apr-09 17:01
gamefreak229120-Apr-09 17:01 
QuestionRe: C++ Directory Functions Pin
David Crow20-Apr-09 17:37
David Crow20-Apr-09 17:37 
AnswerRe: C++ Directory Functions Pin
gamefreak229120-Apr-09 18:16
gamefreak229120-Apr-09 18:16 
AnswerRe: C++ Directory Functions Pin
krmed21-Apr-09 3:03
krmed21-Apr-09 3:03 
QuestionWhat I should Use...bitset, vector &LT bool&GT, or bit_vector? Pin
JohnnyG20-Apr-09 13:51
JohnnyG20-Apr-09 13:51 
I've been trying to read up on some options of what I might be able to use. Perhaps, it can be better explained if I tell you what I would like to do.

I was hoping for a bit oriented class that not only provided storage on a per bit basis but also had the capability to provide an actual value. If you have binary data say in the form of messages in various formats, some of the binary data may use a single bit or a group of bits. In other words, a single bit is really a bit flag or boolean true or false, while a group of bits is a value. Of course, the groups of bits and bit flags may actually be intermixed say in a 16-bit word.

I've got 16-bit words (comprised of bit flags and bit field groups). It would be kind of nice to group the bits into bit fields and flags, e.g. say a 16-bit field comprised of three 4-bit fields, a 2-bit field and two single bit flags. I would like to make the contents of these bit fields somewhat human readable by decoding the binary in the same left to right order as they are stored in binary. We typically do this by using structures. This works fine for decoding but I would like to do something different.

If I could wrap these bit fields and flags into groups within an array or individual objects, I then would have the capability to name or label each object, bit field or group, and perform comparisons on similar data. In other words what may be a 4-bit field in one message may be a 3-bit field in another type of message, by writing a conversion routine between the two types, I still can make a similar comparison and not an exact comparison.

I'd have to design my own class but if I inherit from one of the previously mentioned classes, which one do you think would be best? For now, I have fixed data sizes but may need more flexible and unknown (until runtime) data sizes in the future. I'm not sure if I would want to wrap all of the bitfields or groups of bits that comprise a single message into a single object that would have a message type as a data member but I think I would like to.
AnswerRe: What I should Use...bitset, vector &LT bool&GT, or bit_vector? Pin
Stuart Dootson20-Apr-09 20:07
professionalStuart Dootson20-Apr-09 20:07 
GeneralRe: What I should Use...bitset, vector &LT bool&GT, or bit_vector? Pin
JohnnyG21-Apr-09 11:18
JohnnyG21-Apr-09 11:18 
Questionsprintf and rounding issues [modified] Pin
Jim Crafton20-Apr-09 8:27
Jim Crafton20-Apr-09 8:27 
AnswerRe: sprintf and rounding issues Pin
Stuart Dootson20-Apr-09 8:57
professionalStuart Dootson20-Apr-09 8:57 
AnswerRe: sprintf and rounding issues Pin
Luc Pattyn20-Apr-09 9:20
sitebuilderLuc Pattyn20-Apr-09 9:20 
AnswerRe: sprintf and rounding issues Pin
CPallini20-Apr-09 10:38
mveCPallini20-Apr-09 10:38 
QuestionText in OpenGL Pin
yousuf_227920-Apr-09 8:12
professionalyousuf_227920-Apr-09 8:12 
AnswerRe: Text in OpenGL Pin
Stuart Dootson20-Apr-09 8:24
professionalStuart Dootson20-Apr-09 8:24 
GeneralRe: Text in OpenGL Pin
yousuf_227920-Apr-09 8:31
professionalyousuf_227920-Apr-09 8:31 
GeneralRe: Text in OpenGL Pin
yousuf_227920-Apr-09 8:34
professionalyousuf_227920-Apr-09 8:34 
GeneralRe: Text in OpenGL Pin
Stuart Dootson20-Apr-09 8:43
professionalStuart Dootson20-Apr-09 8:43 
QuestionHeap Memory / COM Object Limits Pin
Steve Thresher20-Apr-09 6:50
Steve Thresher20-Apr-09 6:50 
QuestionExecuting Code on C++ API Exit Pin
turkmeistr120-Apr-09 5:53
turkmeistr120-Apr-09 5:53 
QuestionRe: Executing Code on C++ API Exit Pin
David Crow20-Apr-09 5:57
David Crow20-Apr-09 5:57 
AnswerRe: Executing Code on C++ API Exit Pin
turkmeistr120-Apr-09 6:23
turkmeistr120-Apr-09 6:23 
GeneralRe: Executing Code on C++ API Exit Pin
David Crow20-Apr-09 8:07
David Crow20-Apr-09 8:07 
GeneralRe: Executing Code on C++ API Exit Pin
turkmeistr120-Apr-09 9:07
turkmeistr120-Apr-09 9:07 

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.