fork download
  1. #include <stdio.h>
  2.  
  3. void increment(int thisArray[], int size);
  4.  
  5. int main(void)
  6. {
  7. int testArray[]={1,2,3,4,5,6,7};
  8. int counter;
  9.  
  10. for(counter = 0; counter<7; counter++)
  11. {
  12. printf("%d ", testArray[counter]);
  13. }
  14. printf("\r\n");
  15.  
  16. increment(testArray, 7);
  17.  
  18. for(counter = 0; counter<7; counter++)
  19. {
  20. printf("%d ", testArray[counter]);
  21. }
  22. printf("\r\n");
  23.  
  24. return 0;
  25. }
  26.  
  27. void increment(int thisArray[], int size)
  28. {
  29. int counter = 0;
  30. for(counter=0; counter<size; counter++)
  31. {
  32. thisArray[counter] += 1;
  33. }
  34. }
  35.  
Success #stdin #stdout 0s 5480KB
stdin
Standard input is empty
stdout
1 2 3 4 5 6 7 
2 3 4 5 6 7 8