#include <stdio.h> means??

Dani AI

Generated

Good short answers above. A few practical follow-ups that help once you start compiling, hunting for the header on disk, or fixing "file not found" problems.

The include search path — and why you sometimes get the wrong header — depends on how you write the include and how the compiler is configured. Using the form that tells the compiler to prefer system headers makes the compiler search its system include directories first; the other form searches the current/project directory before the system paths. That means a stray file in your project can shadow the system header. GCC documents the search order and options here: GCC include search path.

What the header actually provides vs where the code lives: headers mainly supply typedefs, macros and function prototypes (for example types like FILE and size_t, macros such as EOF, and prototypes for fopen/fread-style functions). The real implementations live in the C library (libc) and are linked in at build time (usually automatically). Headers also normally protect themselves with include guards or #pragma once so you can safely include them from many files. See the standard library reference and man pages for details: stdio(3) — man page.

Quick troubleshooting: to see the compiler include paths and which files it actually includes, run the compiler in verbose/preprocessor mode:

gcc -v
gcc -E -H yoursource.c

If the header is missing, install the OS/compiler development packages (on Debian/Ubuntu, build-essential; on Red Hat, the glibc-devel packages; on Windows use MinGW or MSVC toolchains). As and noted, this all happens at preprocessing; as noted, IDEs/toolchains put headers in different places — check your compiler settings. For C++ use the C++ wrapper header (see cppreference: cstdio).

Recommended Answers

All 5 Replies

This causes the compiler to read the header file stdio.h which declares and/or defines a number of symbols and functions such as NULL, printf(), stdout, stdin, stderr, etc. These are necessary for general I/O (input/output) actions that all programs need to perform. On Linux/Unix and similar systems, this file is found in the directoryo /usr/include. Not sure where it is on Windows, but it would depend upon the compiler you are using.

@ Faiza akmal

If you have installed Dev C++, then its in C:\Dev-Cpp\include. It varies from compiler to compiler.
As for

include <stdio.h> means??

Check out.

faiza akmal i think u r new in programming... use code::blocks for programming...

commented: BrillianT decuction!!! You should be a detective! -3
commented: wow! how do you come to know about this thing ? ;) hhahahah +0

#include <stdio.h> is a precompiler command and said to compiler 'before starting to compile my file add stdio.h file to this line'

There are several precompiler commands and #include is one of them. stdio.h file name is header file and there are alot of header files.

preprocessor directive which tells the compiler that add these things in file before compilation (a program runs before compilation just for the preprocessor dircetives) as there are many things which compiler will get after including those files like declarations, functions prototypes etc.... ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.