Click here to Skip to main content
15,885,244 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: strange problem with MSVCRT Pin
sach!!10-Aug-06 0:02
sach!!10-Aug-06 0:02 
GeneralRe: strange problem with MSVCRT Pin
AbhishekBK10-Aug-06 1:07
AbhishekBK10-Aug-06 1:07 
GeneralRe: strange problem with MSVCRT Pin
sach!!10-Aug-06 21:02
sach!!10-Aug-06 21:02 
GeneralRe: strange problem with MSVCRT Pin
AbhishekBK10-Aug-06 22:42
AbhishekBK10-Aug-06 22:42 
QuestionMaking Forward Declaration Class's enum Member Visible Pin
yccheok9-Aug-06 21:43
yccheok9-Aug-06 21:43 
Questionsend data from mdichild to other mdichild Pin
ms.linuz9-Aug-06 21:36
ms.linuz9-Aug-06 21:36 
QuestionFile reading error Pin
Anu_Bala9-Aug-06 21:30
Anu_Bala9-Aug-06 21:30 
AnswerRe: File reading error Pin
Cedric Moonen9-Aug-06 21:43
Cedric Moonen9-Aug-06 21:43 
The problem is here:


Anu_Bala wrote:
MdlFile.Read( TempString,sizeof(int)); //it reads "6"


That is false. sizeof(int) returns 4, so you read 4 characters ! You have to make a difference between the size of an integer (always 4 bytes) and the size of the string that represents this character (can vary depending of the number of digits).

If your integer is always smaller than 10, then you can read only one char. But if you don't know how many digits it will contain, then you are in trouble. It is better to store the complete line in a buffer and then scan it for white spaces inside it (like I suggested yesterday). Or use scanf as somebody suggested you also.


Cédric Moonen
Software developer

Charting control

AnswerRe: File reading error Pin
David Crow10-Aug-06 3:22
David Crow10-Aug-06 3:22 
QuestionCan i store DC content as bitmap [modified] Pin
Ramu.e9-Aug-06 21:20
Ramu.e9-Aug-06 21:20 
AnswerRe: Can i store DC content as bitmap Pin
Naveen9-Aug-06 21:30
Naveen9-Aug-06 21:30 
AnswerRe: Can i store DC content as bitmap Pin
Hamid_RT9-Aug-06 21:43
Hamid_RT9-Aug-06 21:43 
AnswerRe: Can i store DC content as bitmap Pin
Hamid_RT9-Aug-06 22:26
Hamid_RT9-Aug-06 22:26 
Questionevent viewer writting problem Pin
_tasleem9-Aug-06 21:16
_tasleem9-Aug-06 21:16 
AnswerRe: event viewer writting problem Pin
kakan9-Aug-06 23:27
professionalkakan9-Aug-06 23:27 
Questionvirtual destructor Pin
lavate malllik9-Aug-06 21:07
lavate malllik9-Aug-06 21:07 
AnswerRe: virtual destructor Pin
ThatsAlok9-Aug-06 21:19
ThatsAlok9-Aug-06 21:19 
GeneralRe: virtual destructor Pin
lavate malllik9-Aug-06 21:29
lavate malllik9-Aug-06 21:29 
AnswerRe: virtual destructor Pin
toxcct9-Aug-06 21:26
toxcct9-Aug-06 21:26 
GeneralRe: virtual destructor Pin
lavate malllik9-Aug-06 21:32
lavate malllik9-Aug-06 21:32 
GeneralRe: virtual destructor Pin
Zac Howland10-Aug-06 4:17
Zac Howland10-Aug-06 4:17 
AnswerRe: virtual destructor Pin
Hamid_RT9-Aug-06 21:29
Hamid_RT9-Aug-06 21:29 
Questionautomation ,passing bitmap in MSWord Pin
Sopi Singh9-Aug-06 20:51
Sopi Singh9-Aug-06 20:51 
QuestionSerial port communication using VC++ Pin
I_arora9-Aug-06 20:38
I_arora9-Aug-06 20:38 
AnswerRe: Serial port communication using VC++ Pin
Cedric Moonen9-Aug-06 21:02
Cedric Moonen9-Aug-06 21:02 

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.