To define a function in C that writes an int or a char from a given string pointer, you can use pointers. Here's an example of how to write an int from a given string pointer:

```c
#include <stdio.h>
#include <stdlib.h>

void write_int(char *str) {
    int num = atoi(str);
    printf("The integer is %d\n", num);
}
```

Here's an example of how to write a char from a given string pointer:

```c
#include <stdio.h>

void write_char(char *str) {
    printf("The character is %c\n", *str);
}
```

In both examples, we use pointers to access the value stored at the location of the string pointer. The `atoi()` function converts a string to an integer.

I hope this helps! Let me know if you have any other questions. 😊

Source: Conversation with Bing, 3/22/2023(1) C - Functions - tutorialspoint.com. https://bing.com/search?q=how+to+define+a+function+in+C+that+writes+an+int+or+a+char+from+a+given+string+pointer Accessed 3/22/2023.
(2) Strings in C: How to Declare & Initialize a String Variables in C - Guru99. https://www.guru99.com/c-strings.html Accessed 3/22/2023.
(3) C - Functions - tutorialspoint.com. https://www.tutorialspoint.com/cprogramming/c_functions.htm Accessed 3/22/2023.
(4) c - How to declare a function pointer that returns a function pointer .... https://stackoverflow.com/questions/50638893/how-to-declare-a-function-pointer-that-returns-a-function-pointer Accessed 3/22/2023.
(5) How can I convert an int to a string in C? - Stack Overflow. https://stackoverflow.com/questions/8257714/how-can-i-convert-an-int-to-a-string-in-c Accessed 3/22/2023.
(6) How to write integers with write() function in C? - Stack Overflow. https://stackoverflow.com/questions/58259818/how-to-write-integers-with-write-function-in-c Accessed 3/22/2023.
(7) C++ Pointers - GeeksforGeeks. https://bing.com/search?q=how+to+write+an+int+or+a+char+from+a+given+string+pointer+in+C Accessed 3/22/2023.
(8) C++ Pointers - GeeksforGeeks. https://www.geeksforgeeks.org/cpp-pointers/ Accessed 3/22/2023.
(9) C Program For Int to Char Conversion - GeeksforGeeks. https://www.geeksforgeeks.org/c-program-for-int-to-char-conversion/ Accessed 3/22/2023.
(10) String Pointer in C - Scaler Topics. https://www.scaler.com/topics/c/string-pointer-in-c/ Accessed 3/22/2023.
(11) Pointer to a string in C? - Stack Overflow. https://stackoverflow.com/questions/15168771/pointer-to-a-string-in-c Accessed 3/22/2023.
(12) C program to Print String using Pointer - Tutorial Gateway. https://www.tutorialgateway.org/c-program-to-print-string-using-pointer/ Accessed 3/22/2023.
(13) C++ Pointers - GeeksforGeeks. https://www.geeksforgeeks.org/cpp-pointers/ Accessed 3/22/2023.
(14) String Pointer in C - Scaler Topics. https://www.scaler.com/topics/c/string-pointer-in-c/ Accessed 3/22/2023.
(15) Pointer to a string in C? - Stack Overflow. https://stackoverflow.com/questions/15168771/pointer-to-a-string-in-c Accessed 3/22/2023.
(16) C string, char and pointers - Stack Overflow. https://stackoverflow.com/questions/37112870/c-string-char-and-pointers Accessed 3/22/2023.