how to convert an integer to binary in Arduino?

for example,

I am getting a character value('0' to 'F') from a stored array, lets say I am getting value of 'A'.

I need to convert that into 1 1 1 1 in an integer array of size 4.

So I have written a function that uses pointer to return the memory location of the converted bits.

But I am not getting what i actually want