Next: snaptrans Up: Programmers Previous: Programmers

Hello World

From $NEMO/src/tutor/hello/hello.c we quote a NEMO version of the infamous hello world program.


/*
 *  HELLO:  Example of ``hello world'' using NEMO 
 *
 *  With the $NEMOBIN/cc script it should compile as follows:
 *             cc -o hello hello.c -lnemo -lm
 *
 *      ??      V1.0    Created                 Peter Teuben
 */

#include <stdinc.h>              /* standard (NEMO) definitions */
#include <getparam.h>                         /* user interface */

string defv[] = {       /* standard keywords and default values */
    "verbose=true\n            Verbosity level (t|f)",  /* key1 */
    "VERSION=1.2\n             25-may-92 PJT",          /* key2 */
    NULL,               /* standard terminator of defv[] vector */
};

string usage = "Example NEMO program 'hello'";    /* usage text */

nemo_main ()              /* standard start of any NEMO program */
{
    bool verbose;                  /* declaration of local var. */

    verbose = getbparam("verbose");         /* get that keyword */
    printf("Hello NEMO!\n");                /* do some work ... */
    if (verbose)                            /* and perhaps more */
        printf("Bye then.\n");
}


teuben@
Sat Oct 8 19:06:02 EDT 1994