316 views
1 votes
1 votes
#include<stdio.h>

void fun(int arr[]){
  int i;
  int arr_size=sizeof(arr)/sizeof(arr[0]);
  for(i=0;i<arr_size;i++){
    printf("%d\t",arr[i]);
  }
}
int main(){
  int i;
  int arr[4]={10,20,30,40};
  fun(arr);
  
}

 

Here why doesn't it output 10 20 30 40. The answer given is 10 20. Please explain this.

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
3
Human asked Oct 8, 2018
593 views
how the answer is 23699?For column major order I get answer as 80039.Even if i go by row major order the answer I get is 23599
2 votes
2 votes
1 answer
4
Ravi kumar singh asked Jan 19, 2018
436 views
Let A be an array with 5 rows and 10 columns. Assume base address is 100 and each element requires 4 bytes. Find the address of A [4,9], if array is stored in row major o...