Announcement

Collapse
No announcement yet.

[Hỏi] Hàm memmove

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Hỏi] Hàm memmove

    _ Tình hình rất là tình hình: e đang làm bài chồng toàn tử "-" cho class String, tham khảo code trên mạng có hàm memmove
    Cụ thể:
    PHP Code:
    void memmove void destination, const void sourcesize_t num ); 
    Đàn anh đi trc có thể giải thích rõ cho e công dụng hàm này đc không ạ? E xin cảm ơn trc !!!

  • #2
    Originally posted by 10520253 View Post
    _ Tình hình rất là tình hình: e đang làm bài chồng toàn tử "-" cho class String, tham khảo code trên mạng có hàm memmove
    Cụ thể:
    PHP Code:
    void memmove void destination, const void sourcesize_t num ); 
    Đàn anh đi trc có thể giải thích rõ cho e công dụng hàm này đc không ạ? E xin cảm ơn trc !!!
    Code:
    MEMMOVE(3)                 Linux Programmer's Manual                MEMMOVE(3)
    
    
    
    NAME
           memmove - copy memory area
    
    SYNOPSIS
           #include <string.h>
    
           void *memmove(void *dest, const void *src, size_t n);
    
    DESCRIPTION
           The  memmove()  function  copies n bytes from memory area src to memory
           area dest.  The memory areas may overlap: copying takes place as though
           the  bytes in src are first copied into a temporary array that does not
           overlap src or dest, and the bytes are then copied from  the  temporary
           array to dest.
    
    RETURN VALUE
           The memmove() function returns a pointer to dest.
    Đây em, bật linux lên gõ lệnh
    Code:
    man memmove
    rồi đọc thôi.

    Comment


    • #3
      Originally posted by 07520004 View Post
      Code:
      MEMMOVE(3)                 Linux Programmer's Manual                MEMMOVE(3)
      
      
      
      NAME
             memmove - copy memory area
      
      SYNOPSIS
             #include <string.h>
      
             void *memmove(void *dest, const void *src, size_t n);
      
      DESCRIPTION
             The  memmove()  function  copies n bytes from memory area src to memory
             area dest.  The memory areas may overlap: copying takes place as though
             the  bytes in src are first copied into a temporary array that does not
             overlap src or dest, and the bytes are then copied from  the  temporary
             array to dest.
      
      RETURN VALUE
             The memmove() function returns a pointer to dest.
      Đây em, bật linux lên gõ lệnh
      Code:
      man memmove
      rồi đọc thôi.
      hic, đọc tiếng anh e không hiểu rõ đc code :'(, chứ mà là TA thì search mạng ra nhiều lắm anh, (

      Comment


      • #4
        Originally posted by 10520253 View Post
        hic, đọc tiếng anh e không hiểu rõ đc code :'(, chứ mà là TA thì search mạng ra nhiều lắm anh, (
        Anh search trong máy anh cứ cần gì phải lên mạng. Em không hiểu chỗ nào mới được?

        Comment


        • #5
          Copies the values of num bytes from the location pointed by source to the memory block pointed by destination. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.

          The underlying type of the objects pointed by both the source and destination pointers are irrelevant for this function; The result is a binary copy of the data.

          The function does not check for any terminating null character in source - it always copies exactly num bytes.

          To avoid overflows, the size of the arrays pointed by both the destination and source parameters, shall be at least num bytes.
          Đây anh :d

          Comment

          LHQC

          Collapse
          Working...
          X