00: Getting started, how to succeed

Getting started—an example program

  • Always write for 2 audiences!
    • people
      • clients, customers
      • teammates
      • team leader, supervisor, project manager
      • colleagues working on documentation, quality assurance, marketing, training
      • your future self
    • the computer
  • First, do nothing well!
  • Work in small steps.
  • Check yourself at every stage.
  • Get a working example from someone else, then type it yourself—learn through your fingers
  • Change the example a little bit, then a little bit more, until the program is your

How to succeed

// "stdio" is "standard input / output"
// "stdlib" is "standard library"

// stdio.h is a header file ( "h" for header)
// stdlib.h is another header file

// a header file contains declarations of
// functions

// need stdio.h to use the printf() functions
#include <stdio.h>

// need stdlib.h to use the exit() function
#include <stdlib.h>

// execution of the program will begin in the main() function
// "argc" means "argument count"
// "argv" means "argument vector"
int main( int argc, char** argv ) {
    // Change the contents of the message as you wish.
    printf( "Good morning!\n" );
    // Make the program print as many messages as you wish.
    printf( "It is a beautiful day.\n" );

    // signal that the program has completed its work successfully
    exit( 0 );
} // main( int, char** )