how do i define a function in C that writes an int or a char from a given string pointer