Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: draw stack bar graph using vc++ Pin
ani_ikram10-Jul-08 22:47
ani_ikram10-Jul-08 22:47 
GeneralRe: draw stack bar graph using vc++ Pin
CPallini10-Jul-08 22:55
mveCPallini10-Jul-08 22:55 
AnswerRe: draw stack bar graph using vc++ Pin
SandipG 10-Jul-08 22:42
SandipG 10-Jul-08 22:42 
Questionwrong variable value from debugger on x64 Pin
George_George10-Jul-08 21:54
George_George10-Jul-08 21:54 
QuestionHow can I make theme-awared transparent control with UXTheme library (MFC / VC++ 2005) Pin
xanagan66610-Jul-08 21:39
xanagan66610-Jul-08 21:39 
Questioni can't understand why this result is showed~ Pin
Jung Seng Won10-Jul-08 21:36
Jung Seng Won10-Jul-08 21:36 
AnswerRe: i can't understand why this result is showed~ Pin
_AnsHUMAN_ 10-Jul-08 21:44
_AnsHUMAN_ 10-Jul-08 21:44 
AnswerRe: i can't understand why this result is showed~ Pin
Cedric Moonen10-Jul-08 21:47
Cedric Moonen10-Jul-08 21:47 
Check the documentation of fgets:

If the End-of-File is encountered and no characters have been read, the contents of str remain unchanged and a null pointer is returned.

The end of file is detected once you try to read after the last character of your file. So, in your case, you will still execute fputs even if the eof was detected. You should do something like this instead:

char* pTemp = fgets(data, sizeof(data)-1, fp);
while (pTemp)
{
   fputs(data, stdout);
   pTemp = fgets(data, sizeof(data)-1, fp);
}


EDIT: oh and BTW, this kind of problem can be tracked quite easily by using your debugger. It is much faster than asking a question on a forum Wink | ;) .

Cédric Moonen
Software developer

Charting control [v1.4]
OpenGL game tutorial in C++

AnswerRe: i can't understand why this result is showed~ Pin
SandipG 10-Jul-08 21:50
SandipG 10-Jul-08 21:50 
AnswerRe: i can't understand why this result is showed~ Pin
CPallini10-Jul-08 22:02
mveCPallini10-Jul-08 22:02 
AnswerRe: i can't understand why this result is showed~ Pin
Stephen Hewitt10-Jul-08 22:12
Stephen Hewitt10-Jul-08 22:12 
Questiongraph using ProEssentials v6 in vc++ Pin
ani_ikram10-Jul-08 21:32
ani_ikram10-Jul-08 21:32 
QuestionHow to communicate between two activex? Pin
manish.patel10-Jul-08 21:09
manish.patel10-Jul-08 21:09 
QuestionConvert English letter to japenese Pin
manju#12310-Jul-08 20:54
manju#12310-Jul-08 20:54 
QuestionRe: Convert English letter to japenese Pin
jazy110-Jul-08 23:09
jazy110-Jul-08 23:09 
AnswerRe: Convert English letter to japenese [modified] Pin
Michael Schubert11-Jul-08 2:48
Michael Schubert11-Jul-08 2:48 
QuestionHow to create a .h file in C++? Pin
Shah Ravi10-Jul-08 20:50
Shah Ravi10-Jul-08 20:50 
AnswerRe: How to create a .h file in C++? Pin
Richard Andrew x6410-Jul-08 20:57
professionalRichard Andrew x6410-Jul-08 20:57 
GeneralRe: How to create a .h file in C++? Pin
Shah Ravi10-Jul-08 21:01
Shah Ravi10-Jul-08 21:01 
GeneralRe: How to create a .h file in C++? Pin
Richard Andrew x6410-Jul-08 21:05
professionalRichard Andrew x6410-Jul-08 21:05 
GeneralRe: How to create a .h file in C++? Pin
Cedric Moonen10-Jul-08 21:39
Cedric Moonen10-Jul-08 21:39 
AnswerRe: How to create a .h file in C++? Pin
T.RATHA KRISHNAN10-Jul-08 22:47
T.RATHA KRISHNAN10-Jul-08 22:47 
AnswerRe: How to create a .h file in C++? Pin
pallaka10-Jul-08 22:47
pallaka10-Jul-08 22:47 
QuestionMemoryleak Pin
T.RATHA KRISHNAN10-Jul-08 20:30
T.RATHA KRISHNAN10-Jul-08 20:30 
AnswerRe: Memoryleak Pin
Cedric Moonen10-Jul-08 20:38
Cedric Moonen10-Jul-08 20:38 

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.