• Welcome to ForumKorner!
    Join today and become a part of the community.

simple C basics

SGT.Code

Active Member
Reputation
0
print a simple message on you screen and explanation on how it works:
Code:
#include <stdio.h>
#include <stdlib.h>

int main()
 {
  printf("hello this was simple to do!\n");
  return 0;
 }

now waht did that mean?

#include <stdio.h> and #include <stdlib.h> are the directives for the preprocesseur (you have to put these on top of all your programes)

int main() is the function name (the name goes between the brakets

{ } are the delimitaions

printf(""); and return 0 ; are the instructions

now for the symbles

\n : goes to new line (enter when typing a post on CHF)
// : add a coment on 1 ligne
/*text here*/ : comment on more that 1 ligne
 
Top