Is there any hierarchy while including header files, like complier provided header files(stdio.h) has to be included first and then the user defined (user.h).
It is unnecessary unless your "user.h" doesn't itself includes the header files it needs.
The best way is for your "user.h" to include files it would need beforehand so it would compile without warnings (errors in C++).
Just make sure you link to the appropriate libraries (eg. libc in gcc).
note: when you create your own header files you should always put them in an inclusion guard
so that the compiler define them only once and will be safe to include them with each other
If that is the case then I might as well use #import directive (from Objective-C/C++ but supported in C/C++ by GCC).
Older compilers did not have #pragmas at all. Forget the #pragma once directive.
Hence it's an old habit hard to get rid of. And besides, I prefer my headers in this old fashioned way.
Although, #pragma once is quite useful, I don't deny that.
The above is simply my view, but the below may apply to others:
Some headers need to redefine things when they are included again. #pragma once may not be helpful here.
Take, for example, the standard <assert.h> - which needs to redefine the assert() macro whenever it gets included depending on the NDEBUG macro definition.
#pragma once is nice since it lets the compiler skip the file instead of having to read the entire file to find the #endif
However, any and all #pragma stuff isn't required to be supported, so for portability, you shouldn't rely on it doing what you think it does. Compiler ABC could say "#pragma once" includes the header file only once, but Compiler XYZ could say "#pragma once" means if the file is included more than once, give an error.