![]() |
|||||||||||||||
|
|||||||||||||||
|
Chapter 3 - Adding some codeOk, sure... all fine... Now let's make a program that actually DO something. To do that we need to teach the compiler a few new words. Let us add a line in the beginning of the program: #include <iostream.h> Before a compiler actually compiles the program it calles upon something called a pre-prossesor. What this does is that it preformes some easy text-anipulation on the text that is later to be compiled. In this case it does the command "include" which places the contents of a file (iostream.h in this case) where the command was invoced. In iostream.h a lot of different commands defined, one that we will use now: #include <iostream.h> To cout we send (<< sends streams of data in the direction of the arrows) a string of characters (surrounded by quotation marks to inticate that it is a string) and then send the endl (end line) instruction to show that this is the end of the line. What cout does is that it will print the string on the screen. < Previous Chapter | Next Chapter > |
Johan Thorstensson, 2003©