Read certain number of bytes from file and print to console in C

byte, c

Solution

See fread http://www.cplusplus.com/reference/cstdio/fread/

This lets you request n bytes of size m from a file stream.

Problem

Hey guys I have been all over the internet and cannot seem to find a simple answer to this. What I want to do is let the user enter how many bytes they want to read (let's call it byteAmount). I want to open a file and read that many bytes from said file, then print it to console using printf. There has got to be an easy way to do this. Thanks in advance!

Original source