Click here to Skip to main content
15,798,592 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help for CStdioFile Read mode [modified] Pin
Adam Roderick J21-Oct-09 20:54
Adam Roderick J21-Oct-09 20:54 
AnswerRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 20:38
Naveen21-Oct-09 20:38 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 21:11
Nicholas Amh21-Oct-09 21:11 
GeneralRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 21:24
Naveen21-Oct-09 21:24 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 22:48
Nicholas Amh21-Oct-09 22:48 
GeneralRe: Need help for CStdioFile Read mode Pin
Richard MacCutchan22-Oct-09 0:18
mveRichard MacCutchan22-Oct-09 0:18 
AnswerRe: Need help for CStdioFile Read mode Pin
theCPkid21-Oct-09 20:42
theCPkid21-Oct-09 20:42 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 21:24
Nicholas Amh21-Oct-09 21:24 
Ya, have been fighting with it for past 3weeks. I can't use fscanf cos i want to set some security. I don't want other user to open the file for reading/writing when my program is using it. Therefore i need to use CFile or CStdioFile. I change my code to
CStdioFile f1;
f1.Open("C:/abc", CFile::modeRead);
int len = f1.GetLength();
char* txt = new char[len+1];
f1.Read(txt, len);
while(_tscanf(txt, "%lf %lf %lf\n", &a, &b, &c) != EOF)
{
.....
....
}
f1.Close();

Using that, it work. But my output result is wrong. The file i am reading consist alot of number and a bit of letter. Thanks
GeneralRe: Need help for CStdioFile Read mode Pin
theCPkid22-Oct-09 1:22
theCPkid22-Oct-09 1:22 
QuestionRe: Need help for CStdioFile Read mode Pin
David Crow22-Oct-09 4:25
David Crow22-Oct-09 4:25 
QuestionRead from text file Pin
sonualex21-Oct-09 20:05
sonualex21-Oct-09 20:05 
AnswerRe: Read from text file Pin
theCPkid21-Oct-09 20:26
theCPkid21-Oct-09 20:26 
GeneralRe: Read from text file Pin
sonualex21-Oct-09 21:32
sonualex21-Oct-09 21:32 
GeneralRe: Read from text file Pin
theCPkid22-Oct-09 1:25
theCPkid22-Oct-09 1:25 
QuestionRe: Read from text file Pin
David Crow22-Oct-09 4:34
David Crow22-Oct-09 4:34 
AnswerRe: Read from text file Pin
sonualex26-Oct-09 21:21
sonualex26-Oct-09 21:21 
QuestionRe: Read from text file Pin
David Crow27-Oct-09 3:59
David Crow27-Oct-09 3:59 
AnswerRe: Read from text file Pin
sonualex27-Oct-09 4:05
sonualex27-Oct-09 4:05 
GeneralRe: Read from text file Pin
David Crow27-Oct-09 4:28
David Crow27-Oct-09 4:28 
GeneralRe: Read from text file Pin
sonualex27-Oct-09 21:29
sonualex27-Oct-09 21:29 
QuestionRe: Read from text file Pin
David Crow28-Oct-09 4:45
David Crow28-Oct-09 4:45 
AnswerRe: Read from text file Pin
sonualex29-Oct-09 0:22
sonualex29-Oct-09 0:22 
GeneralRe: Read from text file Pin
David Crow29-Oct-09 3:20
David Crow29-Oct-09 3:20 
GeneralRe: Read from text file Pin
sonualex30-Oct-09 2:01
sonualex30-Oct-09 2:01 
Question#include problem Pin
kk.tvm21-Oct-09 19:30
kk.tvm21-Oct-09 19:30 

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.