Thanks for your reply.
Maybe because I am using AUTOSAR project, the compilation method is different.
Do you have any advice for the AUTOSAR project on this issue?
This should be related to AUTOSAR,
I saw some answers, for autosar, the standard input/output functions should not be used.
The standard library functions from the '<stdio.h>' / '<cstdio>' and '<wchar.h>' header files can be
dangerous. Their behavior depends on the implementation. Besides, their use might lead to undefined
ehavior.
Sorry, I didn't find any similar function for your direct reference, you need to write it yourself. And as discussed above, for AUTOSAR applications try to avoid using functions in the standard library.