How to find length of string and pass into char array in C?

Hi All
I want to take a Hexadecimal number as input and i want to find lenth of the input and pass it to char s[] ( char s[length of the input] ). I have a program to convert hexadecial to binary but it is taking limited input but i want to return binary number based on input. How?

What i have read in one of my book is :

A constant integer written in headecimal form will take the first of the following type whose size is sufficient to represent it correctly : int, unsigned int, long int, unsigned long int.
you can still force the compiler to use a type long or unsigned by adding the L|l or U|u :

0xFFl
0xFFFFu
0xFFFFlu

In the case your constant is positive and exceed the capacity of the type unsigned long int
OR
In the case your constat is negative and is lower than the lowest number that can be represented in with the type int
... then the ANSI norm does not specify the behaviour (so it may depend on the implementation of your compiler, some will truncate bits to only keep those with 'heavy weight' ... some may return strange result...)