Talk:Sandbox

From LiteratePrograms
Jump to: navigation, search

This a a simple experament to make sure I understand how this works.

Printing hello world in C is easy. It only takes a single statment.

<<print statment>>=
printf("hello world">

But this statment must be put into the main function to be run.

<<main>>=
int main()
{
   print statment
   return 0; /* indicates success */
}

but in order to use the printf command we must first include it.

<<include files>>=
#include <stdio.h>

it all gets put together in one file to be compiled.

<hello.c>>=
include files

main

Just compile and run the file, and that's all there is to it.

hijacker
hijacker
hijacker
hijacker