You don't want to use C++ (unless the purpose is to learn to think, rather than to see the dump). You want to use an existing program that does it for you.
Binary files contain bytes. Bytes can be interpreted to be numbers (even if they are not). Numbers can be shown formatted in hexadecimal base. Dump: read byte (or some bytes), show hex -- for each byte in a file.