What does this function do?

Advertisement

auto buff = new char[50];
std::memset(buff,20,50);

  • It declares a memory buffer named buff that starts at address 20 and ends at address 70.
  • It sets all bits in the array named buffer from its element at index 20 to its element at index 50.
  • It writes the value 20 in every memory address from buff to buff+49.
  • It declares a memory buffer named buff that starts at address 20 and ends at address 50.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.