c++ memcpy return value

前端 未结 5 1626
囚心锁ツ
囚心锁ツ 2021-02-05 02:20

according to http://en.cppreference.com/w/cpp/string/byte/memcpy c++\'s memcpy takes three parameters: destination, source and size/bytes. it also returns a pointer

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 02:45

    You can cast the return into a void if you want to indicate that you aren't using it - eg:
    (void) memcpy(mydest, mysrc, mybytes);

提交回复
热议问题