Question:
What does #include do in C++ programming?
Justyn Huang
2011-05-12 20:02:01 UTC
I'm learning C++ from the very beginning (teaching myself from the C++ for dummies book) and in a majority of the example programs in the book, it starts with things like:

#include
#include
#include

using namespace std;

int main (int nNumberofArgs, char* pszArgs [ ])

and then there is program code that follows this within the { } brackets. But I've looked in the book, and it doesn't seem to specify what the heck that beginning jumble means...

If there is anyone out there that can help me translate what those programming terms are in ENGLISH, that would just be so wonderful!! THANK YOU!! :)

PLEASE HELP!
Four answers:
Kareem
2011-05-12 20:07:11 UTC
#include is a precompiled keyword in C or C++ which is used to include header files into your program. These files allow programmers to separate certain elements of a program's source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers



cstdio is a C++ library to perform Input/Output operations



cstdio => C STDIO => C Standard Input Output functions



Input and Output operations can be performed in C++ using the C Standard Input and Output Library (cstdio, known as stdio.h in the C language).



Input operations such as reading from keyboard and/or reading from a file, and Output operations such as displaying on to a monitor and/or writing to a file.



This library uses what are called streams to operate with physical devices such as keyboards, printers, terminals or with any other type of files supported by the system. Streams are an abstraction to interact with these in an uniform way; All streams have similar properties independently of the individual characteristics of the physical media they are associated with.



Streams are handled in the cstdio library as pointers to FILE objects. A pointer to a FILE object uniquely identifies a stream, and is used as a parameter in the operations involving that stream.



There also exist three standard streams: stdin, stdout and stderr, which are automatically created and opened for all programs using the library.



Thanks, Hope it helps
anonymous
2011-05-12 20:05:22 UTC
It should tell you later, eventually.



The first 3 are the preprocessing code, the #include is often used to tell the compiler as to what software libraries you are using.
anonymous
2016-09-25 03:12:06 UTC
the #incorporate directive tells the compiler so as to add all of the textual content within the incorporate dossier on your programme as in case you had typed it in straight. you and #incorporate any textual content dossier that you just desire. NOTE: it's not a library dossier -- simply the header for one by and large. That is it tells the compiler what quite a lot of library services appear like so they are able to be referred to as safely.
anonymous
2016-11-02 06:13:04 UTC
Cstdio


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...