+ 3
Stdio.h source code
I was looking through the stdio.h file to understand what my computer is actually doing when I call printf. I do not understand the: __mingw_stdio_redirect__ int printf(const char *__format, ...) { ... } The top part that says __mingw_stdio_redirect__ I do not understand. What does this do? I have never even seen code written like this. It is code that just goes over my head.
6 ответов
+ 4
This thread explains __cdecl and __MINGW_NOTHROW.
https://stackoverflow.com/questions/5016435/meaning-of-declaration-of-function
+ 6
It is a macro. That is the most I can tell. A few lines earlier:
#undef __mingw_stdio_redirect__
#define __mingw_stdio_redirect__(F) __cdecl __MINGW_NOTHROW __mingw_##F
+ 5
Honestly though, if you are not planning to write libraries, these details should not pertain to you (i.e. You can be a good programmer without being able to explain stdio's innards). It's good to get to know the contents, but don't stress yourself over this.
+ 2
I see, so what does it really do to the code in general? What is its purpose?
+ 2
Ok, thank you very much. That goes to show how much more there is to learn in C/C++.
+ 2
Well that is a relief. I guess I will just take my time in learning those. Thank you again.