fork download
  1. #include<stdio.h>
  2.  
  3. #define SZ 3
  4.  
  5. typedef struct {
  6. int x[SZ];
  7. } *pthrowaway;
  8.  
  9. int main(void)
  10. {
  11. int A[SZ]={1,2,3};
  12. int B[4][SZ]={0};
  13. int row_select=2;
  14.  
  15. int i, j;
  16.  
  17. for(i = 0; i < 4; i++) {
  18. for(j = 0; j < SZ; j++) {
  19. printf("%d ", B[i][j]);
  20. }
  21. printf("\n");
  22. }
  23.  
  24. *(pthrowaway)&B[row_select] = *(pthrowaway)&A;
  25.  
  26. for(i = 0; i < 4; i++) {
  27. for(j = 0; j < SZ; j++) {
  28. printf("%d ", B[i][j]);
  29. }
  30. printf("\n");
  31. }
  32.  
  33. return 0;
  34. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
0 0 0 
0 0 0 
0 0 0 
0 0 0 
0 0 0 
0 0 0 
1 2 3 
0 0 0