<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>    <head>  <META NAME="topic" content="langage C">  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">  <META HTTP-EQUIV="Content-language" content="fr">  <META NAME="copyright" content="1998 by Jean-Franois Pillou">  <META NAME="expires" content="never">  <META NAME="rating" content="general">  <META NAME="revisit-after" content="7 days">  <META NAME="ROBOTS" content="all">  <META NAME="author" content="Jean-Franois Pillou">  <META NAME="subject" content="Langages informatiques">  <META NAME="rev" content="mailto:webmaster@commentcamarche.net">  <META NAME="keywords" content="introduction au langage C, Langage C, initiation, tutorial, Tutorial, tutorials, tutorial de langage C,atouts,histoire">  <META NAME="title" content="Langage C - Introduction">  <title>Introduction au langage C</title>  <link rel="stylesheet" href="../ccm.css" type="text/css">  </head>    <body bgcolor="#F9FDFE" background="../images/background.gif">      <!-- DEBUT DU SCRIPT -->  <script language="JavaScript" type="text/javascript">  <!--  window.defaultStatus="En vous abonnant  la newsletter, vous restez inform gratuitement des mises  jour par e-mail";       function Prechargement() {     if (document.images) {      var Images = Prechargement.arguments;      if (document.Tableau_Precharg==null) document.Tableau_Precharg = new Array();      var i = document.Tableau_Precharg.length;      with (document) for (var j=0; j < Images.length; j++) {        Tableau_Precharg[i] = new Image;        Tableau_Precharg[i++].src = Images[j];      }    }  }    Prechargement('../images/icohome.gif','../images/icozip.gif','../images/icomail.gif','../images/icoimp.gif','../images/icofav.gif');      // -->  </script>  <!-- FIN DU SCRIPT -->    <table border="0" cellspacing="0" cellpadding="0">  	<tr><td width="183" height="91" bgcolor="#AEBFE2"><a href="http://www.commentcamarche.net" target="_top"><img src="../images/logotop.gif" border="0" width="183" alt="logo CCM"></a></td>    	<td valign="top" align="left">  	<table border="0" cellspacing="0" cellpadding="0">  		<tr><td height="91" bgcolor="#A5B5D6" valign="bottom">  			<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#A5B5D6">  				<tr>  				<td valign="bottom" height="65" width="100%"><img src="/images/ccmbann4.gif" alt="CommentCaMarche.net, le site de vulgarisation informatique"></td></tr>  				<tr><td valign="bottom">  					<table border="0" cellspacing="0" cellpadding="1" width="476" bgcolor="#A5B5D6" >  						<tr>					<td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="/" class="mlink">Accueil</a></td></tr></table></td><td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="/newsletter/" class="mlink">Newsletter</a></td></tr></table></td>  						<td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="/member/" class="mlink">S'identifier</a></td></tr></table></td>						<td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="http://www.commentcamarche.net/forum/" class="mlink">Forum</a></td></tr></table></td>				<td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="/download/" class="mlink">T&eacute;l&eacute;charger</a></td></tr></table></td>  						<td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="/ccmdoc/" class="mlink">Documentations</a></td></tr></table></td>						<td><table border="0" width="100%" bgcolor="#EFF2FB" cellspacing="0" cellpadding="0"><tr><td align="center"><a href="../ccmguide/ccmintro.php3" class="mlink">Aide</a></td></tr></table></td>  						</tr>  					</table>  				</td>  				</tr>  			</table>  		</td>  		<td><img src="../images/bordure.gif" width="17" height="91" alt="bordure"></td>  		</tr>  	</table>  </td></tr>  <tr><td valign="top">    <table border="0" cellspacing="0" cellpadding="0" width="183">  <tr><td valign="top">        	<table border="0" cellspacing="0" cellpadding="0" width="158" bgcolor="#AEBFE2">  		<tr><td valign="top" align="center">    					<table border="0" cellspacing="0" cellpadding="0" width="158" bgcolor="#8EA6D6">  						<tr>  						<td><center><a href="/" onMouseOver="document.icohome.src='../images/icohome.gif';" onMouseOut="document.icohome.src='../images/icohome2.gif';"><img src="../images/icohome2.gif" name="icohome" alt="Page d'accueil" width="24" border="0"></a></center></td>		<td><center><a href="javascript:window.external.AddFavorite('http://www.commentcamarche.net/c/cintro.php3','Langage C - Introduction')" onMouseOver="document.icofav.src='../images/icofav.gif';" onMouseOut="document.icofav.src='../images/icofav2.gif';"><img src="../images/icofav2.gif" name="icofav" alt="Ajouter aux favoris" width="24" border="0"></a></center></td><td><center><a href="http://www.commentcamarche.net/ccmbugs/?Bug_url=%2Fc%2Fcintro.php3#ecrire" onMouseOver="document.icowri.src='../images/icowri.gif';" onMouseOut="document.icowri.src='../images/icowri2.gif';"><img src="../images/icowri2.gif" name="icowri" alt="Signalez une erreur" width="24" border="0"></a></center></td><td><center><a href="/c/cintro.php3?imprim=1"onMouseOver="document.icoimp.src='../images/icoimp.gif';" onMouseOut="document.icoimp.src='../images/icoimp2.gif';"><img src="../images/icoimp2.gif" name="icoimp" alt="Format imprimable" width="24" border="0"></a></center></td>					<td><center><a href="mailto:webmaster@commentcamarche.net" onMouseOver="document.icomail.src='../images/icomail.gif';" onMouseOut="document.icomail.src='../images/icomail2.gif';"><img src="../images/icomail2.gif" name="icomail" alt="Ecrire &agrave; Jean-Francois Pillou" width="24"  border="0"></a></center></td>	  						</tr>  					</table>	<span class="Texte2">Chercher sur CCM</span>  		<table border="0" cellspacing="0" cellpadding="0" width="156" bgcolor="#EFF2FB">  			<tr><td>  			<center><table border="0" cellspacing="0" cellpadding="0"><tr><td valign="middle"><form name="search" method="post" action="/search/search.php3" style="MARGIN: 0px;"><input type="text" name="Mot" size="11"> <input type="submit" value="OK"></form></td><td valign="middle"><form action="/ccmguide/ccmnavig.php3#rechercher" method="post" style="MARGIN: 0px;"><input type="submit" value="&nbsp;?&nbsp;"></form></td></tr></table></center>  			</td></tr>  		</table>        <table border="1" cellspacing="0" bordercolor="#AEBFE2" cellpadding="0" width="156" bgcolor="#EFF2FB"> <tr><td><center><img src="images/menu.gif" alt=""></center></td></tr></table> <table border="1" cellspacing="0" bordercolor="#AEBFE2" cellpadding="0" width="156" bgcolor="#EFF2FB" >        <tr>		<td><a class="mlink" href="cintro.php3" >Introduction</a></td>     </tr> <tr>		<td><a class="mlink" href="ccarac.php3" >Caract&eacute;ristiques</a></td>     </tr> <tr>		<td><a class="mlink" href="cpreproc.php3" >Pr&eacute;processeur</a></td>     </tr> <tr>		<td><a class="mlink" href="ctype.php3" >Types de donn&eacute;es</a></td>     </tr> <tr>		<td><a class="mlink" href="cvar.php3" >Les variables</a></td>     </tr> <tr>		<td><a class="mlink" href="cop.php3" >Les op&eacute;rateurs</a></td>     </tr> <tr>		<td><a class="mlink" href="ccond.php3" >Structures conditionnelles</a></td>     </tr> <tr>		<td><a class="mlink" href="cfonc.php3" >Les fonctions</a></td>     </tr> <tr>		<td><a class="mlink" href="ctab.php3" >Les tableaux</a></td>     </tr> <tr>		<td><a class="mlink" href="cstruct.php3" >Les structures</a></td>     </tr> <tr>		<td><a class="mlink" href="cpoint.php3" >Les pointeurs</a></td>     </tr> <tr>		<td><a class="mlink" href="cstring.php3" >Cha&icirc;ne de caract&egrave;res</a></td>     </tr> <tr>		<td><a class="mlink" href="cliste.php3" >Listes cha&icirc;n&eacute;es</a></td>     </tr> </table>      <center><span class="petit">15 avril 2003</span></center>  		<center><A HREF="http://www.hit-parade.com/hp.asp?site=a23926" TARGET=_top><IMG SRC="http://loga.hit-parade.com/logohp4.gif?site=a23926" ALT="Hit-Parade" WIDTH=77 HEIGHT=15 BORDER=0></A>		   <script language="JavaScript1.1" type="text/javascript"> <!-- hsh = new Date(); hsd = document; hsi = '<a href="http://www.xiti.com/xiti.asp?s=52543"'; hsi += ' TARGET="_top"><img width="39" height="25" border=0 '; hsi += 'src="http://logv12.xiti.com/hit.xiti?s=52543'; hsi += '&amp;p=_c_cintro.php3'; hsi += '&hl=' + hsh.getHours() + 'x' + hsh.getMinutes() + 'x' + hsh.getSeconds(); if(parseFloat(navigator.appVersion)>=4) {Xiti_s=screen;hsi += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;} hsd.writeln(hsi + '&ref=' + hsd.referrer.replace('&', '$') + '" title="Mesurez votre audience"></a>'); //--> </script> <noscript> <a href="http://www.xiti.com/xiti.asp?s=52543" TARGET="_top"><img width="39" height="25" border="0" src="http://logv12.xiti.com/hit.xiti?s=52543&amp;p=_c_cintro.php3" alt="Mesurez votre audience" title="Mesurez votre audience"></a> </noscript>  		 </center> </td></tr> </table>  		</td> 		<td valign="top" align="left" width="25"><img src="../images/arrondi.gif" width="25" height="24" alt="arrondi"></td> 		</tr> 	</table>  </td> <td valign="top" align="left">   <table border="0" cellspacing="0" cellpadding="2" width="500"> <tr> <td>      <table border="0" cellpadding="0" cellspacing="0">      <tr>          <td width="85%"><img src="images/cintro.gif" alt="introduction au langage C"></td>          <td valign="top" width="5%"><a href="../index.php3" target="_top"><img src="../images/bckward.gif" border="0" alt="Page pr&eacute;c&eacute;dente"></a></td>          <td valign="top" width="5%"><a href="../ccmsites/sites.php3?Mot=langage C"><img src="../images/sites.gif" width="58" height="68" alt="Sites sur le m&ecirc;me sujet" border="0"></a></td>          <td valign="top" width="5%"><a href="../ccmdoc/search.php3?Mot=langage C"><img src="../images/docs.gif" width="53" height="68" alt="T&eacute;l&eacute;charger des documentations" border="0"></a></td>         <td valign="top" width="5%"><a href="ccarac.php3"><img src="../images/forward.gif" border="0" alt="Page suivante"></a></td>          <td valign="top" width="5%"><a href="../index.php3" target="_top">  	<img src="../images/logoPClw.gif" alt="Retour &agrave; la page d'accueil" border="0"></a></td>      </tr>  </table>  <hr>     <p align="justify">  <table bgcolor="#EFF2FB"border="0" cellspacing="0" cellpadding="1" width="100%">  <tr><td>  <a name="histoire"><span class="Titre">Petite histoire du C</span></a>  </td></tr>  </table>  <p align="justify">     Le langage C a &eacute;t&eacute; mis au point par <b>D.Ritchie</b> et <b>B.W.Kernighan</b> au d&eacute;but  des ann&eacute;es 70. Leur but &eacute;tait de permettre de d&eacute;velopper un langage  qui permettrait d'obtenir un syst&egrave;me d'exploitation de type <a href="../unix/unixintro.php3">UNIX</a>  portable. D.Ritchie et B.W.Kernighan se sont inspir&eacute;s des langages B et BCPL, pour cr&eacute;er un nouveau langage:  le langage C.    <p align="justify">La premi&egrave;re d&eacute;finition de ce langage a &eacute;t&eacute; donn&eacute;e dans  leur livre commun &quot;The C programming language&quot;.  <br/>Toutefois, suite &agrave; l'apparition de nombreux compilateurs C, l'ANSI (abr&eacute;viation  de <i>American National Standards Institute</i>) a d&eacute;cid&eacute; de normaliser ce langage pour  donner ce que l'on appelle le <b>C-ANSI</b>. Suite &agrave; cette norme, Ritchie et  Kernighan ont sorti une deuxi&egrave;me &eacute;dition du livre en int&egrave;grant les modifications  apport&eacute;es par l'ANSI.       <p align="justify">  <table bgcolor="#EFF2FB"border="0" cellspacing="0" cellpadding="1" width="100%">  <tr><td>  <a name="atoutse"><span class="Titre">Les atouts du C</span></a>  </td></tr>  </table>  <p align="justify">     Le langage C reste un des langages les plus utilis&eacute;s actuellement. Cela est d&ucirc;  au fait que le langage C est un langage comportant des instructions et des structures de haut niveau  (contrairement &agrave; l'<a href="../asm/assembleur.php3">assembleur</a> par exemple) tout  en g&eacute;n&eacute;rant un code tr&egrave;s rapide gr&acirc;ce &agrave; un compilateur  tr&egrave;s performant.    <p align="justify">Un des principaux intrts du C est que c'est un langage trs <b>portable</b>.   Un programme crit en C en respectant la norme ANSI est portable sans modifications sur   n'importe quel syst&egrave;me d'exploitation disposant d'un compilateur C : Windows, UNIX, VMS   (systme des VAX) ou encore OS/390 ou z/Os (l'OS des mainframes IBM).   <p align="justify">La rapidit des programmes crits en C est en grande partie due au fait que le compilateur   <i>prsuppose</i> que le programmeur sait ce qu'il fait: il gnre un code ne contenant pas   de vrifications sur la validit des pointeurs, l'espace d'adressage, etc.   <br/>Ainsi, les programmes en C sont tr&egrave;s compacts.   <p align="justify">De plus, une des caractristiques du C est qu'il est un langage "faiblement typ" :   les types de donnes qu'il manipule sont trs restreints, et proches de la reprsentation interne par le processeur :   par exemple, le type 'Chane de caractres' n'existe pas en C. A l'inverse, comparer un entier et un caractre a un sens   en C car un caractre est bien reprsent en interne par le processeur par une valeur de type   entier (le code ASCII ou le code EBCDIC).   <p align="justify">Enfin et pour conclure, il est inexact que le C est un langage difficile  apprendre!   Au contraire: Le C dispose de peu d'instructions, les structures de donnes sont limites, etc.   <br/>Le C est un langage concis et son apprentissage est beaucoup moins ardu que ne peut l'tre celui du Pascal par exemple;     <p align="justify">L'apprentissage du C est ainsi n&eacute;cessaire pour quiconque s'int&eacute;resse  &agrave; la programmation, et cet apprentissage en vaut la peine !     <p align="justify">  <table bgcolor="#EFF2FB"border="0" cellspacing="0" cellpadding="1" width="100%">  <tr><td>  <a name="cvsc++"><span class="Titre">Le C++ par rapport au C</span></a>  </td></tr>  </table>  <p align="justify">       Le <a href="../cpp/cppintro.php3">C++</a> est un langage bas&eacute; sur le langage C, auquel on a rajout&eacute; des &eacute;l&eacute;ments  de telle mani&egrave;re &agrave; int&eacute;grer le <a href="../poo/poointro.php3">concept objet</a>.  C'est <b>Bjarne Stroustrup</b> qui a cr&eacute;&eacute; la premi&egrave;re version de ce langage, appel&eacute;  C++.    <p align="justify">   <hr>  <a href="../index.php3" target="_top"><img src="../images/bckward.gif" border="0" alt="Page pr&eacute;c&eacute;dente"></a>   <a href="ccarac.php3"><img src="../images/forward.gif" border="0" alt="Page suivante"></a>      <a name="annotation"></a> <table border="1" bordercolor="#AEBFE2" bgcolor="#EFF2FB" cellspacing="0" cellpadding="2" width="500">  <tr> <td  bgcolor="#AEBFE2" height="22" colspan="3" width="100%"><center><span class="texte2">Services CCM associ&eacute;s &agrave; cet article</span></center></td> </tr>  <tr> 	<td valign="bottom"><img src="/images/carre.gif" alt=""><a href="/newsletter/" class="mlink">Devenir membre</a></td> 	<td valign="bottom"><img src="/images/carre.gif" alt=""><a href="/c/cintro.php3?imprim=1" class="mlink">Format imprimable</a></td> 	<td valign="bottom"><img src="/images/carre.gif" alt=""><a href="/ccmbugs/?Bug_url=%2Fc%2Fcintro.php3#ecrire" class="mlink">Signaler une erreur<sup>1</sup></a></td> 	</tr> 	 	<tr><td valign="bottom" colspan="3"><img src="/images/ampoule.gif" align="middle" alt="Participez aux forums"><a href="/forum/" class="mlink"> Participez aux forums de CommentCaMarche</a></td></tr> 	</table> <ul> <li><span class="Texte">Merci de signaler toute erreur rencontr&eacute;e lors de la lecture de cet article (lien invalide, faute d'orthographe, non sens) ou bien d'apporter des &eacute;l&eacute;ments pouvant approfondir l'article.</span></li> </ul>  <p> <table border="0" cellspacing="0" cellpadding="2" width="500"> <tr> <td> <center> <span class="Texte">&copy; Copyright 2003 <a href="http://www.commentcamarche.net">Jean-Fran&ccedil;ois Pillou</a> - H&eacute;berg&eacute; par <a href="http://www.web-solutions.fr">Web-solutions.fr</a>. <br>Ce document issu de <a href="http://www.commentcamarche.net">CommentCaMarche.net</a> est soumis &agrave; <a href="/ccmguide/ccmlicence.php3">la licence GNU FDL</a>. Vous pouvez copier, modifier des copies de cette page tant que cette note appara&icirc;t clairement.</span> </center> </td></tr> </table>    </td></tr> </table>  </td></tr> </table>  </body>  </html>    
