C Programming - Arrays - Discussion

Discussion Forum : Arrays - Point Out Correct Statements (Q.No. 2)
2.
Which of the following statements mentioning the name of the array begins DOES NOT yield the base address?
1: When array name is used with the sizeof operator.
2: When array name is operand of the & operator.
3: When array name is passed to scanf() function.
4: When array name is passed to printf() function.
A
A, B
B
B, D
Answer: Option
Explanation:

The statement 1 and 2 does not yield the base address of the array. While the scanf() and printf() yields the base address of the array.

Discussion:
20 comments Page 1 of 2.

Pavan said:   1 decade ago
Any body explain me?

Indu said:   1 decade ago
Is &a doesn't represents base address.

Pranita said:   1 decade ago
Can you explain why &a doesn't represent base address?

Neeraj said:   1 decade ago
Yes &a doesn't represents base address, it actually represents the address of the first element of the array.

Adi said:   1 decade ago
because it represents pointer to whole array even if contains first element address for eg.
int a[3];// let location be 1000
&a=> 1st address
But
&a+1=> address 1012

Jackman said:   1 decade ago
'&a' ->pointer to an array 'a'
'a' ->shows the base address of an array 'a'

Tanvi said:   1 decade ago
Nice explanation Adi.

Pranavi said:   1 decade ago
Please tell me which represents exactly base address?

Jasmin said:   1 decade ago
What is exactly the difference b/w base address and address of first element?

Khushi said:   1 decade ago
&a will give the base address?


Post your comments here:

Your comments will be displayed after verification.