Warning: file_exists() [function.file-exists]: Unable to access /mnt/167/sdb/c/4/prepamp/docs/N.avancees/kit_Photos/site_flash/admin/libs/amfphp/amf-core/adapters/lib/style.css.php in /mnt/112/sdb/c/4/prepamp/docs/infos/lire.php(1) : eval()'d code on line 1
Informatique


Informatique

C/C++ : Créer une fonction

  1. /* Créer une fonction */
  2. type nomFonction( /* parametres */){
  3. /* instructions */
  4. }
  5.  
  6. /* --- Exemple d'utilisation --- */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11. int main(){
  12.  
  13. /* Addition de deux entiers */
  14. long addtionN2(long a, long b){
  15. return a + b;
  16. }
  17.  
  18. /* Multiplcation de deux entiers */
  19. long multiplicationN2(long a, long b){
  20. return a * b;
  21. }
  22.  
  23. /* Fonction particulière sans return */
  24. void bonjour(){
  25. printf("bonjour");
  26. }
  27.  
  28. getchar();
  29. return 0;
  30. }



En rapport avec ces documents



    Vos commentaires


    Connectez-vous !

    Les dernières nouveautés