I was looking to use OpenSSL to encrypt text in a file, and will need the text to be in an unsigned char array before I encrypt it. What is the easiest way read text from a
Read it in whatever data type of your liking. Cast to (unsigned char*) is guaranteed to give you access to the individual bytes.
(unsigned char*)
Edit: This is an answer for C, and not C++. Originally the question was tagged C, too.