Skip to main content
Post Made Community Wiki by CommunityBot
Source Link
ddimitrov
  • 3.4k
  • 3
  • 35
  • 48

If the array happens to be int or anything with the size of int or your mem-pattern's size fits exact times into an int (i.e. all zeroes or 0xA5A5A5A5), the best way is to use memset().

Otherwise call memcpy() in a loop moving the index.