0

What is the difference between "stdio.h" & <stdio.h> in c

23rd Nov 2020, 6:02 AM
Samir Imtiaz
Samir Imtiaz - avatar
3 Antworten
+ 9
Okay! When write #include<stdio.h> You tell the compiler to search for the file ‘stdio.h’ in the standard library folders only . but when you write #include”stdio.h” You mean that search the file ‘stdio.h’ in the standard library functions as well as in the current folder where you are working . Now suppose you have stored this file any other place like c/documents/stdio.h then you just need to write the correct path in them like #include”c/documents/stdio.h” and the compiler will include these files into your current program. In such situations #include<c/documents/stdio.h> WILL NOT WORK !! Hope this helps! :-)
23rd Nov 2020, 6:30 AM
Steve Sajeev
Steve Sajeev - avatar
+ 23
The significant difference is that <stdio.h> tries to find in standard C library locations,as of "stdio.h" searches in both the current directory as well as in library locations. Generally, we would use <...> for standard C libraries and "..." for libraries that you write and are located in the current directory. Source: https://stackoverflow.com/questions/3845415/what-is-the-difference-between-stdio-h-and-stdio-h#:~:text=11-,%3Cstdio.,the%20current%20directory%20as%20well.
23rd Nov 2020, 6:08 AM
Aditya
Aditya - avatar