Click here to Skip to main content
11,717,883 members (80,958 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC6
I have to read a data from number of characters specified
here i have to read 1 character but assertion is thrown and when i see l_chBuf1 1 character with junk y code how to solve this.
TCHAR is used to support unicode characters but
Assertion is throwing.How shall i get 1 character data?

TCHAR * l_chBuf1 = new TCHAR[nCharCount];
l_nBytesRead = l_oStdioFile.Read(l_chBuf1,1);

nCount=2
during fread it is reading a character as well as junk characters.How to avoid this.If i use Whole word to read it is reading properly without junk characters.
if ((nRead = (UINT)fread(pszMultiByteString, sizeof(BYTE), nCount, m_pStream))
Posted 25-Dec-11 19:34pm
Edited 25-Dec-11 21:47pm
v3
Comments
SAKryukov at 26-Dec-11 1:50am
   
A little more detail please. What assertion, exactly?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 849
1 OriginalGriff 215
2 F-ES Sitecore 210
3 Maciej Los 140
4 Jochen Arndt 120
0 Sergey Alexandrovich Kryukov 1,494
1 OriginalGriff 535
2 Maciej Los 529
3 Richard MacCutchan 440
4 CHill60 415


Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 26 Dec 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100