与えられた文字列ポインタからintまたはcharを書き出す関数をCで定義するには、ポインタを使います。以下は、与えられた文字列ポインタからintを書き出す方法の例である：

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

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

与えられた文字列ポインタからcharを書き出す例を示します：

```c
#include <stdio.h>

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

どちらの例でも、文字列ポインタの位置に格納されている値にアクセスするためにポインタを使用しています。関数 `atoi()` は文字列を整数に変換する。

お役に立てれば幸いです！他に質問があれば教えてください。

出典Bing との会話、3/22/2023(1) C - 関数 - tutorialspoint.com. https://bing.com/search?q=how+to+define+a+function+in+C+that+writes+an+int+or+a+char+from+given+string+pointer Accessed 3/22/2023.
(2) C言語の文字列：C言語で文字列変数を宣言・初期化する方法 - Guru99. https://www.guru99.com/c-strings.html Accessed 3/22/2023.
(3) C - 関数 - tutorialspoint.com. https://www.tutorialspoint.com/cprogramming/c_functions.htm Accessed 3/22/2023.
(4) c - 関数ポインタを返す関数ポインタの宣言方法 ... https://stackoverflow.com/questions/50638893/how-to-declare-a-function-pointer-that-returns-a-function-pointer Accessed 3/22/2023.
(5)C言語でintを文字列に変換するには？- Stack Overflow. https://stackoverflow.com/questions/8257714/how-can-i-convert-an-int-to-a-string-in-c Accessed 3/22/2023.
(6) Cでwrite()関数を使って整数を書くには？- 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+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) C言語での文字列ポインタ - スケーラートピックス. https://www.scaler.com/topics/c/string-pointer-in-c/ Accessed 3/22/2023.
(11) 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) C の文字列ポインタ - スケーラートピックス. https://www.scaler.com/topics/c/string-pointer-in-c/ Accessed 3/22/2023.
(15) C で文字列へのポインタ？- Stack Overflow. https://stackoverflow.com/questions/15168771/pointer-to-a-string-in-c Accessed 3/22/2023.
(16) C の文字列、char、ポインタ - Stack Overflow. https://stackoverflow.com/questions/37112870/c-string-char-and-pointers Accessed 3/22/2023.
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.