- The best way to get started on your programming journey,
is to write some simple programs
that are easy to understand and change.
To handle that task, it helps to know
the basics of input and output, or I/O.
In this movie, I introduce you to the concept of I/O,
and how that plays into programming.
You'll get to explore some basic I/O functions,
and use one of those functions to create
tiny programs that output interesting text.
A program has to do something, that something involves
taking input and generating output.
This is how a typical C Program works.
It's a machine that does something to input,
and then generates output.
If the program doesn't do anything,
then it's basically plumbing;
what comes in goes out.
The C Library offers a host of output functions,
of the lot, these three are the most popular.
They are pronounced, printf, putchar, and puts.
Each function is designed to send one or more characters
to the standard output device,
which is the screen or terminal window.
The "puts" function, puts, or sends
a string of text to standard output.
"Puts" is put string, and a string is a collection
of characters enclosed in double quotes.
This function is defined in the STDIO header file
which is included at line one.
In the exercise source code,
I've specified the "puts" function, but omitted the string.
Your job is to type the string, so click the mouse
a midst the parenthesis,
and type the string argument for the "puts" function.
Type a double quote,
the editor automatically supplies the closing quote.
Type some text.
If the editor doesn't supply the closing quote,
you must type it.
Otherwise the compiler doesn't see the end of the string,
and an ugly error is generated.
You can also type the quote, even if it's supplied,
and the editor is smart enough not to double up.
The string is highlighted in blue, save, build, and run.
There's the output, exactly as you typed.