fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i = 0;
  6. int x[5] = {0, 1, 2, 3, 4};
  7. int y[5];
  8. int *ptr = x;
  9. while (i<5){
  10. y[i] = x[i];
  11. printf("Value of y[%d] is : %d\n", i, y[i]);
  12. i++;
  13. }
  14.  
  15. return 0 ;
  16. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
Value of y[0] is : 0
Value of y[1] is : 1
Value of y[2] is : 2
Value of y[3] is : 3
Value of y[4] is : 4