Click here to Skip to main content
16,005,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCopying all of vector elemetns to Another ??? Pin
Hadi Rezaee30-Jul-02 5:23
Hadi Rezaee30-Jul-02 5:23 
AnswerRe: Copying all of vector elemetns to Another ??? Pin
Chris Losinger30-Jul-02 5:28
professionalChris Losinger30-Jul-02 5:28 
GeneralRe: Copying all of vector elemetns to Another ??? Pin
Hadi Rezaee30-Jul-02 5:47
Hadi Rezaee30-Jul-02 5:47 
AnswerRe: Copying all of vector elemetns to Another ??? Pin
Joaquín M López Muñoz30-Jul-02 9:23
Joaquín M López Muñoz30-Jul-02 9:23 
GeneralRe: Copying all of vector elemetns to Another ??? Pin
Hadi Rezaee31-Jul-02 5:30
Hadi Rezaee31-Jul-02 5:30 
GeneralCMOnthCalCtrl Pin
Nick Jacobs30-Jul-02 5:12
Nick Jacobs30-Jul-02 5:12 
GeneralRe: CMOnthCalCtrl Pin
JennyP30-Jul-02 6:01
JennyP30-Jul-02 6:01 
Generalgarbage in last line of text read with fread.... Pin
ns30-Jul-02 4:12
ns30-Jul-02 4:12 
Hi,
I am doing:

if( (stream = fopen( "C:\\myjunk.txt", "r+t" )) != NULL )
  {
           // Compute the size of the file
       fseek(stream, 0, SEEK_END);
           int nSize = ftell(stream);
       // Put the file pointer at the beginning
       fseek(stream, 0, SEEK_SET);

       // Allocate a buffer big enough
       char* list = new char[nSize + 1];  //check for null pointer
               numread = fread( list, nSize, 1, stream );
           list[nSize]=0;
           m_rich1.SetWindowText(list);

               m_edit1.SetWindowText(list);
               fclose( stream );
  }



In both the richedit and the edit, after all the valid text, I get a line of garbage. What am I doing wrong? How can I fix this?
Thanks,
ns
GeneralRe: garbage in last line of text read with fread.... Pin
Christian Graus30-Jul-02 4:17
protectorChristian Graus30-Jul-02 4:17 
GeneralWoW! That helped!!! Thanks! Pin
ns30-Jul-02 5:20
ns30-Jul-02 5:20 
GeneralRe: WoW! That helped!!! Thanks! Pin
Christian Graus30-Jul-02 12:26
protectorChristian Graus30-Jul-02 12:26 
GeneralA bunch of interesting articles! Pin
ns31-Jul-02 5:00
ns31-Jul-02 5:00 
GeneralRe: garbage in last line of text read with fread.... Pin
Rutger Ellen30-Jul-02 4:36
Rutger Ellen30-Jul-02 4:36 
GeneralRe: garbage in last line of text read with fread.... Pin
ns30-Jul-02 5:31
ns30-Jul-02 5:31 
GeneralRe: garbage in last line of text read with fread.... Pin
Roger Wright30-Jul-02 4:37
professionalRoger Wright30-Jul-02 4:37 
GeneralRe: garbage in last line of text read with fread.... Pin
ns30-Jul-02 5:34
ns30-Jul-02 5:34 
GeneralRelease mode crashes, debug mode doesn't (and it's not my code) Pin
Jason Hihn30-Jul-02 3:48
Jason Hihn30-Jul-02 3:48 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Alexandru Savescu30-Jul-02 4:05
Alexandru Savescu30-Jul-02 4:05 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Jason Hihn30-Jul-02 4:21
Jason Hihn30-Jul-02 4:21 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Daniel Turini30-Jul-02 12:17
Daniel Turini30-Jul-02 12:17 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Christian Graus30-Jul-02 4:05
protectorChristian Graus30-Jul-02 4:05 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Rutger Ellen30-Jul-02 4:11
Rutger Ellen30-Jul-02 4:11 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Carlos Antollini30-Jul-02 4:45
Carlos Antollini30-Jul-02 4:45 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
Vivek Rajan30-Jul-02 6:14
Vivek Rajan30-Jul-02 6:14 
GeneralRe: Release mode crashes, debug mode doesn't (and it's not my code) Pin
includeh1030-Jul-02 6:41
includeh1030-Jul-02 6:41 

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.