fork(4) download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #define size 5
  4.  
  5. void addcon(int *ptr,int num,int con)
  6. {
  7. for(int k=0; k<num;k++){
  8. *ptr= *(ptr++) + con;
  9. }
  10. }
  11.  
  12. int main(){
  13. static int array[size] = {3,5,7,9,11};
  14. int konst = 10;
  15. int j;
  16.  
  17. addcon(array,size,konst);
  18. for(j=0;j<size;j++)printf("%d ",array[j]);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
3 13 23 33 43