top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Are the expressions arr and &arr same for an array of integers?

+1 vote
1,140 views

Are the expressions arr and &arr same for an array of integers?

posted May 12, 2016 by Hasan Raza

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

yes because both arr and &arr give the same base address of an array.
try this example :

int main() 
{
 int arr[10];
 printf("%dn",arr);
 printf("%d",&arr);
return 0;
}
answer May 20, 2016 by Shivam Kumar Pandey
0 votes

Yes, Both are same,
Array name represents the starting address of an array

answer May 13, 2016 by Chirag Gangdev
arr and &arr have same base address but arr+1 and &arr+1 are not same. arr have only base address but &arr have address of whole array.
Similar Questions
0 votes

Given an array of sorted integers and find the closest value to the given number. Array may contain duplicate values and negative numbers.

Example : Array : 2,5,6,7,8,8,9
Target number : 5
Output : 5

Target number : 11
Output : 9

Target Number : 4
Output : 5

+2 votes

Say you are given an array which has all duplicate members except one, which out this non-duplicate member.

...