TCS
Company
Programming
Arrays
In C, if you pass an array as an argument to a function, what actually gets
passed?
1.Value of elements in array
2.First element of the array
3.Base address of the array
4.Address of the last element of array
Read Solution (Total 3)
-
- Base address of array
- 6 years agoHelpfull: Yes(8) No(0)
- Base address of the array will be passed.
- 5 years agoHelpfull: Yes(0) No(0)
- 3. Base address
- 4 years agoHelpfull: Yes(0) No(0)
TCS Other Question
What does the following declaration mean?
int (*ptr)[10];
1.ptr is array of pointers to 10 integers
2.ptr is a pointer to an array of 10 integers
3.ptr is an array of 10 integers
4.ptr is an pointer to array
What will be the output of the program ?
#include
int main()
{
int a[5] = {5, 1, 15, 20, 25};
int i, j, m;
i = ++a[1];
j = a[1]++;m = a[i++];
printf("%d, %d, %d", i, j, m);
return 0;
}
1. 2, 1, 15
2. 1, 2, 5
3. 3, 2, 15
4. 2, 3, 20