Wipro
Company
Programming
Technical
10) When an array of pointers is passed through a function, what actually is passed?
1) address of the starting element
2) last element
3) first element
4) number of elements
Read Solution (Total 16)
-
- option 1
Reason : When any array is passed through a function,always the address of starting element is passed - 10 years agoHelpfull: Yes(13) No(0)
- In Function value can be pass by two way
1) Call by Value
2) Call by Reference
In Call by Value direct elements is passed in function.
In Call by Reference address is passed in function.
Array is the collection of multiple elements which are stored in contiguous memory location.
so if address of first element is known the we can access all the element.
address of all element can be find by formula given below by changing array index i
address of element a[i]= Base address(address of first element)+i*size of datatype
where a[] is array and i is array index
a[0] is first element a[1] second and so on...
In question we are passing an Array of pointer, So we will use Call by Reference
So we will pass only the ADDRESS OF THE STARTING ELEMENT
ANSWER: ADDRESS OF THE STARTING ELEMENT - 9 years agoHelpfull: Yes(5) No(1)
- 1) address of the starting element
- 10 years agoHelpfull: Yes(1) No(0)
- ans:= 1227.33m
Distance=speed*time
(56*(10^3)*78.9)/3600=1227.33m - 10 years agoHelpfull: Yes(1) No(3)
- int getResult(Foo* fooPtrArray[])
{
Statements-----;
Statements-----;
}
Doing this would pass the address of the starting element. - 9 years agoHelpfull: Yes(1) No(0)
- option 1
Reason : When array is passed through a function call it passes the address of first element only. - 10 years agoHelpfull: Yes(0) No(0)
- address of the starting element
- 10 years agoHelpfull: Yes(0) No(0)
- pointers generally store address when an array of pointers through a unction address of the starting element is passed
- 10 years agoHelpfull: Yes(0) No(0)
- 1. address......
- 9 years agoHelpfull: Yes(0) No(0)
- 1 because pointers are pointing an adress and array stores the sequential addresses
- 9 years agoHelpfull: Yes(0) No(0)
- option 1 is correct
- 9 years agoHelpfull: Yes(0) No(0)
- Ans-1)address of the starting element
- 9 years agoHelpfull: Yes(0) No(0)
- address of the starting element.
- 9 years agoHelpfull: Yes(0) No(0)
- address of starting element
- 8 years agoHelpfull: Yes(0) No(0)
- 1 is correct
- 6 years agoHelpfull: Yes(0) No(0)
- option 1 is correct
- 6 years agoHelpfull: Yes(0) No(0)
Wipro Other Question