Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioncan VC++ create a MAC version Pin
Mohsen Saad9-Mar-05 7:18
Mohsen Saad9-Mar-05 7:18 
Questioncan VC++ create a MAC version Pin
Mohsen Saad9-Mar-05 7:17
Mohsen Saad9-Mar-05 7:17 
AnswerRe: can VC++ create a MAC version Pin
Jeryth9-Mar-05 8:03
Jeryth9-Mar-05 8:03 
AnswerRe: can VC++ create a MAC version Pin
Maximilien9-Mar-05 8:39
Maximilien9-Mar-05 8:39 
AnswerRe: can VC++ create a MAC version Pin
Ravi Bhavnani9-Mar-05 12:14
professionalRavi Bhavnani9-Mar-05 12:14 
AnswerRe: can VC++ create a MAC version Pin
Steen Krogsgaard9-Mar-05 22:09
Steen Krogsgaard9-Mar-05 22:09 
GeneralRe: can VC++ create a MAC version Pin
Anonymous10-Mar-05 5:52
Anonymous10-Mar-05 5:52 
GeneralProblem reading 0x08 from file. Pin
eddo019-Mar-05 6:31
eddo019-Mar-05 6:31 
Hey guys, I'm new here and not very experienced with C++ so I'd appreciate any help.

I'm trying to read a binary file and put the contents into a structure. However, I run into a problem whenever I come across 0x08, which results in my code only reading 8 instead of 08 into my structure. Here is part of my code.

// structure i'm using
struct something
{
char head1;
char head2;
};

int main()
{
something packet;
fstream data;
fstream output;

// open the file for input in binary mode
data.open("test.dat", ios::in | ios::binary);
output.open("dataoutput.dat", ios::out);

// reading contents of file
data.read(reinterpret_cast<char *="">(&packet), sizeof(packet));

output << "Primary Header Info: " << endl;
output << packet.head1 << packet.head2 << endl;

data.close();
output.close();
return 0;
}

The result I get in my strucutre is 820 instead of 0820. Any ideas as to why Confused | :confused: ? TIA
GeneralRe: Problem reading 0x08 from file. Pin
karle9-Mar-05 8:42
karle9-Mar-05 8:42 
GeneralRe: Problem reading 0x08 from file. Pin
David Crow9-Mar-05 10:15
David Crow9-Mar-05 10:15 
GeneralProblem in Wizard - OnCancel / OnWizardFinish Pin
g3e9-Mar-05 4:57
g3e9-Mar-05 4:57 
GeneralCall a Managed DLL from Unmanaged MFC Class Pin
morefalt9-Mar-05 4:42
morefalt9-Mar-05 4:42 
GeneralShort-circuit evaluation questions. Pin
rbid9-Mar-05 3:58
rbid9-Mar-05 3:58 
GeneralRe: Short-circuit evaluation questions. Pin
Blake Miller9-Mar-05 4:36
Blake Miller9-Mar-05 4:36 
GeneralRe: Short-circuit evaluation questions. Pin
Ryan Binns9-Mar-05 17:35
Ryan Binns9-Mar-05 17:35 
GeneralRe: Short-circuit evaluation questions. Pin
Steen Krogsgaard10-Mar-05 2:28
Steen Krogsgaard10-Mar-05 2:28 
GeneralRetreiving SafeArray Values from IDispatch Pin
Member 17837689-Mar-05 3:27
Member 17837689-Mar-05 3:27 
GeneralCapturing screenshots of fullscreen dos applications. Pin
Renny[RuS]9-Mar-05 2:50
Renny[RuS]9-Mar-05 2:50 
GeneralRe: Capturing screenshots of fullscreen dos applications. Pin
David Crow9-Mar-05 3:02
David Crow9-Mar-05 3:02 
GeneralRe: Capturing screenshots of fullscreen dos applications. Pin
Renny[RuS]9-Mar-05 9:34
Renny[RuS]9-Mar-05 9:34 
GeneralMixed Language Programming(c++ &amp; fortran) Pin
lavate malllik9-Mar-05 1:25
lavate malllik9-Mar-05 1:25 
GeneralRe: Mixed Language Programming(c++ &amp; fortran) Pin
Cedric Moonen9-Mar-05 2:16
Cedric Moonen9-Mar-05 2:16 
GeneralRe: Mixed Language Programming(c++ &amp; fortran) Pin
lavate malllik9-Mar-05 16:59
lavate malllik9-Mar-05 16:59 
GeneralDispatch Issue Pin
Lord Phoenix9-Mar-05 1:19
Lord Phoenix9-Mar-05 1:19 
GeneralMDI application with a Tree View Pin
rgchezhian9-Mar-05 1:01
rgchezhian9-Mar-05 1:01 

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.