Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What will happen if you dont write #include<stdio.h> in a C programe?

user-image
Question ajoutée par himanshu mittal
Date de publication: 2013/06/27
Daanish Rumani
par Daanish Rumani , Product Manager , Publicis Sapient

The code will compile but you would not be able to use printf() and scanf().
You can write programs that do not need to use the console like a web server! Further you can write your own implementation of printf() and scanf() using C/assembly code if you desire to reinvent the wheel.
Many games may be already written that may not be using printf() and scanf() but use other libraries such as OpenGL, DirectX etc.

yes, because by default stdio.h is included

dinesh kumar
par dinesh kumar , Software engineer , Srivari infotech

means standard input output , if u print "hello " means .
if need this header file, if any think process in c language very important need in this head file, with out this header file , u dont access and run this program.
error will occur while compile time.

Wrishin Bhattacharya
par Wrishin Bhattacharya , Graduate Trainee , Tata Consultancy Services

#include is known as Pre-processor Directive.
it means that the programmer is giving a direction to the C-compiler that it should include or attach the "stdio" header file before processing the code written afterwards.
Without this directive the code will not work at all.

stdio.h stands for standard input output.And .h means header file.So if we don't use this we can't access the program as well as program will not be run(because there is no header file)

#include is the command used to include all the predefined functions from the library to the program, while compiling...If we not use that, no problem for Turbo IDE.It will work...

Preetham D
par Preetham D , Software Engineer / Senior Software Engineer , Mindtree

Even if u do not include u can execute the basic programs, but you cannot use standard functions which is defined in the library function/header "stdio.h>" which will ultimately lead you the system crash/error.

you all are partially correct.
the code won't compile.
because the printf and scanf methods are not linked unless we write #include

Muhammad Usman
par Muhammad Usman , Assistant Manager , Pakistan Steel Mills

We use #include to add library of functions for use in C Language.
If we use some functions in our program but not added its library using #include, C Language Program cannot compile and generate errors.
invalid functions.

All the information given by siniya pn is absolutely correct but one thing, without # program may not execute or run.

siniya pn
par siniya pn , Senior document controller/ project coordinator , Barek engineering

#include is the commands that essentially pastes previously written code into your program.stdio.h is a header file, where this and other similar functions are defined.
stdio.h stands for standard input output header.
symbols instead of "" means the header is located in the standard search path.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?