String to char array conversion
If you're trying to use a method of a in the global scope, that's doomed to failure. You can only call methods within functions.

If all you want is a char array with "45317" in it then just use:

char *b = "45317";


If you want to convert a string that is built at runtime into a char array, then your current method is correct - you just have to do it in the right place.