Include statement

Han sang yeob·2021년 2월 10일
0

Basic of C language

목록 보기
5/9

Include statement basically means, you want to include contents of a file that contains source code in that same programming language that you're writing in right into your program at the point that you tell it to do the include.
So, in general, here's how it works.

......
......
Include someFile
......
......

Let's imagine that we're looking at a bit of a program that you are writing. Now as soon as you put include statement into your program, what you're basically saying is take the file(somefile) and effectively put the contents of that file right at this point in the program.
So, as soon as you put that include statement in any of your programs, the entire contents of the file you specify effectively get placed right into your program right where you put the include statement.

Now this is important for many reasons. Libraries are a collection of useful functions that you will use in your programs in order to do more advanced things. So, let's imagine that you have a program that draw a circle and let's suppose that that program relies on a library(drawing library) that has 5,000 lines of code. If we think about writing every 5,000 line of code whenever we want to draw library, it is terrible.
There are many benefits to using include statements. Remember programmers are always looking for ways to make things easier not harder.

profile
Learning IT in Vietnam

0개의 댓글