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

C / C++ / MFC

 
GeneralRe: Retrieve HTML as string behind proxy Pin
Ravi Bhavnani2-May-05 7:43
professionalRavi Bhavnani2-May-05 7:43 
GeneralProblem with DirectDraw Pin
SuperTank2-May-05 5:35
SuperTank2-May-05 5:35 
GeneralProblem solved Pin
SuperTank2-May-05 6:21
SuperTank2-May-05 6:21 
QuestionHow to execute a EXE remotely Pin
Killer32-May-05 4:23
Killer32-May-05 4:23 
AnswerRe: How to execute a EXE remotely Pin
ThomasABBE2-May-05 12:13
ThomasABBE2-May-05 12:13 
GeneralC++ and Word2003 Pin
perle12-May-05 4:15
perle12-May-05 4:15 
Generalbinary file i/o Pin
triplefour2-May-05 3:51
triplefour2-May-05 3:51 
GeneralRe: binary file i/o Pin
Anonymous2-May-05 4:28
Anonymous2-May-05 4:28 
ok well i guess i got the i/o working

but now im kind of stuck
where i have
for (int x =0; x <2; x++)
that runs the loop 2 times and loads 2 8bit values into the binary file.
but i want this loop to run for the length of the input file.
whats the easy way to do that?

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

void main()
{
char rtextbit[8];
char binarybyte =0; //chars are 8 bits 0 means 00000000
char textbit[8];
ifstream textfile;
textfile.open("bin.txt");

ofstream binaryfile ("realbin.txt", ios::out|ios::binary);

for (int x =0; x <2; x++)
{

for (int i = 0; i < 8; i++) //get the 8 bytes from the plain text file
textbit[i] = textfile.get();


cout<
GeneralRemote Shutdown using Named Pipe Pin
Girish6012-May-05 3:19
Girish6012-May-05 3:19 
QuestionHow to run an application when clicking &quot;Shut Down&quot; from start menu? Pin
jahfer2-May-05 3:08
jahfer2-May-05 3:08 
AnswerRe: How to run an application when clicking "Shut Down" from start menu? Pin
David Crow2-May-05 7:32
David Crow2-May-05 7:32 
GeneralRe: How to run an application when clicking &quot;Shut Down&quot; from start menu? Pin
r i s h a b h s3-May-05 0:05
r i s h a b h s3-May-05 0:05 
GeneralRe: How to run an application when clicking &quot;Shut Down&quot; from start menu? Pin
David Crow3-May-05 3:55
David Crow3-May-05 3:55 
GeneralActiveX (Formula 1) Grid , Cell value (date ) Problem Pin
zahid_ash2-May-05 2:29
zahid_ash2-May-05 2:29 
GeneralAccelerator doesnt work Pin
DKT_2-May-05 2:09
DKT_2-May-05 2:09 
GeneralC++ Help Pin
Rob_BCFC2-May-05 2:07
sussRob_BCFC2-May-05 2:07 
GeneralRe: C++ Help Pin
Rob_BCFC2-May-05 2:08
sussRob_BCFC2-May-05 2:08 
GeneralRe: C++ Help Pin
David Crow2-May-05 2:10
David Crow2-May-05 2:10 
GeneralRe: C++ Help Pin
Rob_BCFC2-May-05 2:14
sussRob_BCFC2-May-05 2:14 
GeneralRe: C++ Help Pin
Cedric Moonen2-May-05 2:20
Cedric Moonen2-May-05 2:20 
GeneralRe: C++ Help Pin
Rob_BCFC2-May-05 2:25
sussRob_BCFC2-May-05 2:25 
GeneralRe: C++ Help Pin
Cedric Moonen2-May-05 2:35
Cedric Moonen2-May-05 2:35 
GeneralRe: C++ Help Pin
V.2-May-05 3:32
professionalV.2-May-05 3:32 
GeneralRe: C++ Help Pin
David Crow2-May-05 2:48
David Crow2-May-05 2:48 
GeneralRe: C++ Help Pin
Rob_BCFC2-May-05 4:53
sussRob_BCFC2-May-05 4:53 

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.