title: Is there a function or simple code in c++ that does the same as int.to_bytes()?
body: <p>I just started my first c++ project. Its a simple project, I want to convert an integer to bytes. So I was wondering if there is any function or simple code in c++ that does the same as <code>int.to_bytes(integer, size, byteorder=&quot;little&quot;)</code> in python.</p>