memset赋值0和-1,还能赋其他值吗?.pdfVIP

  • 10
  • 0
  • 约小于1千字
  • 约 1页
  • 2022-07-26 发布于上海
  • 举报
memset赋值0和-1,还能赋其他值吗? 今天⽤memset时发现它不能给⼀个数组赋值1,于是就花时间了解了⼀下它。先上msdn的介绍: Sets buffers to a specified character. dest c count void * ( void * , int , size_t ); Return Value returns the value ofdest. Parameters dest Pointer to destination c Character to set count Number of characters Remarks count dest c. The function sets the first bytes of to the character 最后⼀句翻译过来就是:memset函数将dest所指的前count字节的内存空间赋值为c。先看⼀段程序吧 很容易知道0和-1的⼆进制表⽰分别为0000 0000以及1111

文档评论(0)

1亿VIP精品文档

相关文档