Reading text from file to unsigned char array

前端 未结 3 1841
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 02:04

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

3条回答
  •  温柔的废话
    2021-01-01 02:36

    Read it in whatever data type of your liking. Cast to (unsigned char*) is guaranteed to give you access to the individual bytes.

    Edit: This is an answer for C, and not C++. Originally the question was tagged C, too.

提交回复
热议问题