Click here to Skip to main content
15,906,766 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStunning GUI .. How ? Pin
AbinThomas24-Jan-05 0:27
AbinThomas24-Jan-05 0:27 
AnswerRe: Stunning GUI .. How ? Pin
Maximilien24-Jan-05 3:07
Maximilien24-Jan-05 3:07 
GeneralMulti-Language app trouble Pin
Deian24-Jan-05 0:22
Deian24-Jan-05 0:22 
Questionhow to change regional setting Pin
venu_vooda23-Jan-05 22:36
venu_vooda23-Jan-05 22:36 
AnswerRe: how to change regional setting Pin
ThatsAlok23-Jan-05 23:47
ThatsAlok23-Jan-05 23:47 
GeneralCross platform GUID's Pin
Giles23-Jan-05 22:24
Giles23-Jan-05 22:24 
Generalreading a file - one bit at a time Pin
2000ram23-Jan-05 22:17
2000ram23-Jan-05 22:17 
GeneralRe: reading a file - one bit at a time Pin
toxcct23-Jan-05 22:27
toxcct23-Jan-05 22:27 
1 bit, one 1 byte ???

you have many functions to read files, but only 1 byte at least.

what you could do so is reading the byte, and exctracting its bit that's interresting you...

for example, i want the bit b4 of the first byte of the file (i consider b0 is the LSB, and b7 is the MSB) :
<font color=#0000FF>int </font>file = fopen(<font color=#808080>"file1.txt"</font>, <font color=#808080>"r"</font>);
<font color=#0000FF>char </font>cByte = 0;
fscanf(file, <font color=#808080>"%c"</font>, &cByte);
<font color=#0000FF>bool </font>bBit_b4 = (cByte & 0x10) >> 4;
<font color=#0000FF>if </font>(bBit_b4) {
    <font color=#008000>// b4 was set to 1</font>
}
else {
    <font color=#008000>// b4 was set to 0
</font>}



TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralRe: reading a file - one bit at a time Pin
2000ram23-Jan-05 23:41
2000ram23-Jan-05 23:41 
QuestionAnything wrong with this? Pin
Yulianto.23-Jan-05 22:11
Yulianto.23-Jan-05 22:11 
AnswerRe: Anything wrong with this? Pin
David Crow24-Jan-05 2:42
David Crow24-Jan-05 2:42 
AnswerRe: Anything wrong with this? Pin
James R. Twine24-Jan-05 3:37
James R. Twine24-Jan-05 3:37 
GeneralSendMessage Pin
Yulianto.23-Jan-05 21:54
Yulianto.23-Jan-05 21:54 
GeneralRe: SendMessage Pin
ThatsAlok23-Jan-05 22:21
ThatsAlok23-Jan-05 22:21 
GeneralRe: SendMessage Pin
ThatsAlok23-Jan-05 22:22
ThatsAlok23-Jan-05 22:22 
GeneralRe: SendMessage Pin
Yulianto.23-Jan-05 22:50
Yulianto.23-Jan-05 22:50 
GeneralRe: SendMessage Pin
ThatsAlok23-Jan-05 23:42
ThatsAlok23-Jan-05 23:42 
GeneralRe: SendMessage Pin
Mircea Puiu23-Jan-05 22:42
Mircea Puiu23-Jan-05 22:42 
GeneralOutput formatting Pin
hugPW23-Jan-05 21:31
hugPW23-Jan-05 21:31 
GeneralRe: Output formatting Pin
David Crow24-Jan-05 2:49
David Crow24-Jan-05 2:49 
GeneralRe: Output formatting Pin
hugPW24-Jan-05 3:12
hugPW24-Jan-05 3:12 
GeneralRe: Output formatting Pin
David Crow24-Jan-05 3:25
David Crow24-Jan-05 3:25 
GeneralRe: Output formatting Pin
hugPW24-Jan-05 5:40
hugPW24-Jan-05 5:40 
GeneralRe: Output formatting Pin
David Crow24-Jan-05 9:02
David Crow24-Jan-05 9:02 
GeneralRe: Output formatting Pin
hugPW24-Jan-05 5:43
hugPW24-Jan-05 5:43 

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.