summaryrefslogtreecommitdiff
path: root/cbook/one_one.c
blob: 98960262f5c392494e8e2333aeef600e4a39f5f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <stdio.h>

/*
* Tell the compiler that we intend
* to use a function called show_message.
* It has no arguments and returns no value
* This is the "declaration".
*
*/

void show_message(void);
/*
* Another function, but this includes the body of
* the function. This is a "definition".
*/
int main(){
     int count;

     count = 0;
     while(count < 10){
             show_message();
             count = count + 1;
     }

     return(0);
}

/*
* The body of the simple function.
* This is now a "definition".
*/
void show_message(void){
     printf("hello\n");
}