Click here to Skip to main content
15,905,238 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: compiler setting Pin
vaibhav shinde23-Feb-06 2:58
vaibhav shinde23-Feb-06 2:58 
QuestionWriting a browser plugin Pin
ice_and_fire23-Feb-06 2:55
ice_and_fire23-Feb-06 2:55 
AnswerRe: Writing a browser plugin Pin
David Crow23-Feb-06 2:56
David Crow23-Feb-06 2:56 
QuestionCalling a function Pin
srija23-Feb-06 2:22
srija23-Feb-06 2:22 
AnswerRe: Calling a function Pin
toxcct23-Feb-06 2:27
toxcct23-Feb-06 2:27 
QuestionRe: Calling a function Pin
David Crow23-Feb-06 2:55
David Crow23-Feb-06 2:55 
QuestionError In Building simple ATL application Pin
maharaja pandian23-Feb-06 1:46
maharaja pandian23-Feb-06 1:46 
QuestionHow to Execute a process before win logon??? Pin
Mohiul Alam Chowdhury Rony23-Feb-06 1:37
Mohiul Alam Chowdhury Rony23-Feb-06 1:37 
AnswerRe: How to Execute a process before win logon??? Pin
James R. Twine23-Feb-06 2:42
James R. Twine23-Feb-06 2:42 
AnswerRe: How to Execute a process before win logon??? Pin
Roger Stoltz23-Feb-06 2:51
Roger Stoltz23-Feb-06 2:51 
QuestionRe: How to Execute a process before win logon??? Pin
Mohiul Alam Chowdhury Rony23-Feb-06 16:53
Mohiul Alam Chowdhury Rony23-Feb-06 16:53 
AnswerRe: How to Execute a process before win logon??? Pin
David Crow23-Feb-06 3:00
David Crow23-Feb-06 3:00 
QuestionBuffer Overrun in SQLDriverConnect()? Pin
meet2nishith23-Feb-06 1:26
meet2nishith23-Feb-06 1:26 
QuestionRe: Buffer Overrun in SQLDriverConnect()? Pin
David Crow23-Feb-06 3:06
David Crow23-Feb-06 3:06 
AnswerRe: Buffer Overrun in SQLDriverConnect()? Pin
meet2nishith23-Feb-06 3:16
meet2nishith23-Feb-06 3:16 
QuestionCrystal Reports 11 with visual Studio .NET Pin
Irfan Shahid23-Feb-06 1:07
Irfan Shahid23-Feb-06 1:07 
QuestionPls Help Pin
trinadh_t23-Feb-06 0:48
trinadh_t23-Feb-06 0:48 
AnswerRe: Pls Help Pin
murali_utr23-Feb-06 0:52
murali_utr23-Feb-06 0:52 
GeneralRe: Pls Help Pin
trinadh_t23-Feb-06 1:10
trinadh_t23-Feb-06 1:10 
GeneralRe: Pls Help Pin
murali_utr23-Feb-06 1:30
murali_utr23-Feb-06 1:30 
GeneralRe: Pls Help Pin
Dennis Gourjii23-Feb-06 1:33
Dennis Gourjii23-Feb-06 1:33 
JokeRe: Pls Help Pin
jhwurmbach23-Feb-06 22:13
jhwurmbach23-Feb-06 22:13 
QuestionBest way to Write and read from a file Pin
fearless stallion23-Feb-06 0:48
fearless stallion23-Feb-06 0:48 
I am using win32 APIs for this project. I have to write records into a file and for that i was using FILE * fp; fwrite() and fread(). the Structure i am writing into file contains char fn[100];char sn[1000];char dt[20];char tm[20]; int ET;. Now for few reasons i had to change the sturcture and change the "dt" and "tm" fields to two different structures.each having three Integer variables.Now When i am trying to write records into the file it is working fine but when i am trying read from the file it just dies at the new "tm" sturcture's first int variable. While debugging i found that the other two variables contain some illegal values. the statement while(fread(&data,sizeof(data),1,fp)==1) breaks and goes to the next line of loop which is fclose(fp); before changing to new structure it was working fine(both read and write).

Why is it so? and is fread and fwrite are not safe ways to write records into a file ? if so, then, is there any better solutions for this? can anybody suggest the best Riskfree and Errorfree way to write and read from a file? cause i have to read and write to this file 10 times a minute(approx). Sniff | :^)

Thanks in advance

kss
AnswerRe: Best way to Write and read from a file Pin
James R. Twine23-Feb-06 0:57
James R. Twine23-Feb-06 0:57 
GeneralRe: Best way to Write and read from a file Pin
fearless stallion23-Feb-06 1:58
fearless stallion23-Feb-06 1:58 

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.