Difference between revisions of "Langage C"

From Fixme.ch
Jump to: navigation, search
(code part)
(code part)
Line 61: Line 61:
  
 
<code>
 
<code>
#include <stdio.h>                  // entrée - sortie
+
#include <stdio.h>                  // entrée - sortie
int main()
+
int main()
{
+
{
  retunr 0;   
+
  retunr 0;   
}
+
}
 
</code>
 
</code>
  

Revision as of 15:55, 3 March 2015


Description

In french :

En se basant sur le livre "Le langage C" de Tony Zang, une idée est venue d'y faire les exercices mais en réalisant un vrai programme en mode console et qui par la suite peut évoluer en mode graphique, ou autres, mais allons par étapes... avec d'autres rajouts toujours autour du langage C.

Ce wiki ne se veut pas un cours de C ou un tuto mais plutôt un projet autour de l'apprentissage du langage C.

L'onglet discussion peut être fort intéressant concernant des astuces, questions, problèmes rencontrés lors de développement en C, alors n'hésiter pas à compléter ce wiki et la page discussion et le projet "GITHUB" qui lui sera associé :-)

In english

On the book "Le langage C" of Tony Zang, an idea is come to make the all exercices but to realize a complet program in consol mode in a first time.

This wiki is not a cours or a tuto, just a project arround of C langage.

Development Environment

For Windows

-> Dev environment for Philou :

  • Windows XP SP3
    • Code::Blocks 10.5 - GNU GCC Compiler (mingw32-gcc)

For Linux

Projet Source

treated chapter (Aperçu & Codes & Astuce)

chapter 1 (résumé)

In french : dans ce chapitre, un petit résumé sur le langage C, la norme 'ANSI'.

In english in this chapter, a summary on the language C and the ANSI norm.

Trick

In french :

différence entre un langage bas et haut niveau.

 => Le langage bas niveau est une représentation de 0 et 1, on appelle ça aussi le langage machine. 
 => Le langage haut niveau est langage qui peut être interpréter par l'homme. Le C est un langage haut niveau    

comme le langage C est de type haut niveau, il faudra le compiler avec un compiler pour que la machine puisse l'interpréter (langage bas niveau). Il faudra le faire sur chaque machine ou l'on travaille

In English :

difference between a language down or high level.

 => Down language is a representation of 1 and 0. It call also machine code. 
 => High language is a language which can be interpreted by a person. The C language is of high type. 

the language C is of high level, it would using a compiler for that the device undertsand the language (down level) and make this operation on each device (PC) where we work.

chapter 2 (résumé)

In french : dans ce chapitre, sont vue les notions de directive (inclue), de fichier d'en-tête (header file -> .h), de commentaire (// ou /* */), de la fonction principale MAIN, de la fonction EXIT, du saut de ligne ('\n')...

In English: in this chapter, we see the concepts of commandes (include), of header file (.h), of commentaries (// or /* */), of principale function MAIN and the function EXIT, of line break ('\n')...

code part

structur to begin a C programme

  1. include <stdio.h> // entrée - sortie

int main() {

 retunr 0;   

}

Trick

In french : en C, les commentaires officielle se notent de cette manière :

In English: In C, the official commentaries wrote in this manner

*/ ceci est un commentaire officiel */

In french : mais on peut aussi voir des commentaires de comme ceci, même si cela ne fait pas partie de la norme 'ANSI, mais accepté par de nombreux compilateurs:

In English: we can see also commentaries displayed like below, but it is not in the 'ANSI norm, same if more compilators agree that.

// ceci est aussi un commentaire

Liens utiles

liens : documentation PDF

liens : documentation Site Internet

Bibliographie

  • Le Langage C | Auteur : Tony Zhang | ISBN: 2-7440-1518-0


en cours de construction

Participant