CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: read/write file

  1. #1
    Join Date
    Sep 1999
    Location
    Hong Kong
    Posts
    34

    read/write file

    I write a program in read/write file.Besides, if I want to send binary files through CSocket, what i should indicate?(becasuse i find that i can send text file sucessfully, but
    I fail in sending a binary file. I only send first 4 bytes of the file then stop.

    If I write the following:
    CString buffer=m_pBuffer;

    where m_pBuffer is char*
    are there any problem if I assign this?





  2. #2
    Join Date
    Oct 1999
    Location
    Sofia, Bulgaria
    Posts
    8

    Re: read/write file

    This will create object that contain all characters from m_pBuffer to the occurence of '\0'

    Constructur of CString think that m_pBuffer
    is zero-terminated string (C-style string)
    Thus all remaining chars after '\0' will be
    truncated
    Also if in the block pointed from m_pBuffer
    no one character is '\0' constuctor will access
    illegal memory after this block



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured