How do I sign a sha-256 hash with a private key in C++

I've been trying to generate a signature for contents of a text file with RSA implementation in C++ but unsure of how to do that.

I've created a private/public key and I've generated a SHA-256 hash of the message contents of a text file with the library Message Digest. I was told to use modular exponentiation to sign the hash value but how do I do modexp a hash message if it is not a number?

For some reason, I can't wrap my head around using mod exponentiation for my SHA-256 message to get a signature with my private key.