C
Programming and Technical
Programming
Technical
Are the expressions arr and &arr same for an array of
integers?
Read Solution (Total 3)
-
- Yes both are same
if A[] is array
then
its name A shows base address of arry= &A[0] and &A also shows base address= &A[0]
base address is address of first element of array
BOTH HAVE SAME MEANING, YOU CAN USE ANYONE OF THEM - 9 years agoHelpfull: Yes(1) No(0)
- arr is to define the size or a value of array. but &arr is the address of arr
- 9 years agoHelpfull: Yes(0) No(0)
- yes. both will give the base address of an array.
- 6 years agoHelpfull: Yes(0) No(0)
C Other Question
If char=1, int=4, and float=4 bytes size, What will be the output of the program ?
#include
int main()
{
char ch = 'A';
printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f));
return 0;
}
Options
1) 1, 2, 4
2) 1, 4, 4
3) 2, 2, 4
4) 2, 4, 8
Does mentioning the array name gives the base address in
all the contexts?