How do we know to use a particular header file in C programming?
I am new to C Programming and I have observed that we can perform similar tasks while using either of the header files "iostream.h" and "stdio.h". Because functions such as "cout" and "cin" in "iostream.h" can perform similar tasks as can "printf" and "scanf" when we are using the header file "stdio.h".
So how do we know which header file to use when? Is there a difference (in using particular header files and functions) when we are programming via different platforms i.e Dev C++, Microsoft Visual C++, Turbo C++ or different operating systems?
A header file is a file containing C declarations and macro definitions to be shared between several source files. You request the use of a header file in your program by including it, with the C preprocessing directive `#include'.
I've myself got the answer to this question. Actually I started learning C Programming as a course in my studies, and having the wrong book led me into this confusion.
The tutor was actually teaching C language on the C++ (Dev C++) platform whereas the book I had was "C How to Program". Therefore the difference in the use of the header files "iostream.h" and "stdio.h" as I've (now) found out from my tutor lies in that iostream.h is used in C++ while stdio.h in C programming.
by Naveed Ahmed3 years ago
I get an error about the header file while I try to compile my C program in Dev C++, how do I solve?I am using Dev C++ to write my first C program. My tutor taught me to use "iostream.h" file in the header,...
by nassarbashar6 years ago
C programmingWrite a program that takes an integer keyed in from the terminal and extracts anddisplays each digit of the integer in English. So, if the user types in 932, the programshould displaynine three twoRemember...
by asit gaine7 years ago
what is the main use of header files?
by akumarcom5 years ago
What tools are require to learn C programming language?I want to learn C language so that I need the required tools. Please also post the tool links.
Copyright © 2018 HubPages Inc. and respective owners.
Other product and company names shown may be trademarks of their respective owners.
HubPages® is a registered Service Mark of HubPages, Inc.