Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void copie(int tableauOriginal[],int tableauCopie,int tailleTableau);
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int tableauOriginal[4]={1,2,3,4};
  9. int tableauCopie[]= { };
  10. copie(tableauOriginal,tableauCopie,4);
  11. int i;
  12. for (i = 0; i < 4; i++)
  13. printf("Case: %dn", tableauCopie[i]);
  14. return 0;
  15. }
  16.  
  17. void copie(int tableauOriginal[],int tableauCopie,int tailleTableau)
  18. {
  19.  
  20. int i ;
  21. for (i = 0; i < tailleTableau; i++)
  22. tableauCopie=tableauOriginal[i];
  23. }
  24.  
  25. int tableauCopie[]= { };
  26.  
  27. int tableauCopie[4];
  28.  
  29. void copie(int tableauOriginal[],int tableauCopie[],int tailleTableau)
  30.  
  31. void copie(int tableauOriginal[],int tableauCopie,int tailleTableau)
  32.  
  33. void copie(int tableauOriginal[], int tableauCopie[], int tailleTableau)
  34. {
  35.  
  36. int i ;
  37. for (i = 0; i < tailleTableau; i++)
  38. tableauCopie = tableauOriginal[i];
  39. }
  40.  
  41. #include <stdio.h>
  42. #include <stdlib.h>
  43. void copie(int *tableauOriginal,int *tableauCopie,int tailleTableau);
  44.  
  45. int main(int argc, char *argv[])
  46. {
  47. int tableauOriginal[4]={1,2,3,4};
  48. int tableauCopie[4]= {0};
  49. copie(tableauOriginal,tableauCopie,4);
  50. int i;
  51. for (i = 0; i < 4; i++)
  52. printf("Case: %dn", tableauCopie[i]);
  53. return 0;
  54. }
  55.  
  56. void copie(int *tableauOriginal,int *tableauCopie,int tailleTableau)
  57. {
  58. int i ;
  59. for (i = 0; i < tailleTableau; i++)
  60. tableauCopie[i]=tableauOriginal[i];
  61. }
  62.  
  63. int i ;
  64. for (i = 0; i < tailleTableau; i++)
  65. tableauCopie[i] = tableauOriginal[i];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement