1. Hello world in C


Table of contents

  1. Introduction
  2. Compiling and running
  3. Testing
  4. Deploying
  5. Appendix : Call graph

1. Introduction

This is an example hello world C program. We can define codeblocks with ---

Some example flow diagram:

Flow


some text.


The main function


int main()
{
	 1. Print a string
	return 0;
}
Used in:
  1. hello.c @ 1.1.1

Now we can define the Includes codeblock:


Include files


#include <stdio.h>
Used in:
  1. hello.c @ 1.1.1

Finally, our program needs to print "hello world"


Print a string


printf("Hello, world!\n");
Used in:
  1. The main function @ 1.1.2

2. Compiling and running


compile.sh


#!/bin/sh

gcc hello.c -o hello

to run : just enter command sh run.sh to run.


run.sh


#!/bin/sh

sh ./compile.sh

./hello

3. Testing

Should show an output that looks like this:

4. Deploying

Just copy the hello file and run it!

OR run the command:

$ sh run.sh

5. Appendix : Call graph