Results 1 to 2 of 2

Thread: CStrings

  1. #1

    Thread Starter
    Lively Member ExciteMouse's Avatar
    Join Date
    Jul 2000
    Location
    Dallas, TX
    Posts
    78

    Question

    lets say i have this:

    Code:
    '//Make BUFFER have 10 nulls
    unsigned char* BUFFER = (unsigned char*)malloc(10);
    memset(BUFFER, 0x0, 10);
    
    '//make a cstring and buffer it
    CString MyStr;
    MyStr.GetBufferSetLength(10);
    
    '//Now how to i insert BUFFER to MyStr with out doing a loop and using MyStr.SetAt() ?
    
    MyStr.ReleaseBuffer(0);
    free(BUFFER);

  2. #2

    Thread Starter
    Lively Member ExciteMouse's Avatar
    Join Date
    Jul 2000
    Location
    Dallas, TX
    Posts
    78

    Exclamation got it

    ok i got it.. all you do is use the CString::GetBuffer function.

    Code:
    memcpy(MyStr.GetBuffer(10), BUFFER, 10);

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