TCS
Company
Programming
Output
int **ptr; is?
1. Pointer to integer
2. None of these
3. Pointer to pointer
4. Invalid declaration
Read Solution (Total 2)
-
- if we declare
int *ptr than this is integer type pointer.
when we declare
int **ptr; // declaring double pointers
We know that a pointer points to a location in memory and thus used to store address of variables.Such as:
int main()
{
int a = 8; *ptr; //*ptr is int type pointer
ptr = &a;
return 0;
}
So, when we define a pointer to pointer. The first pointer is used to store the address of second pointer. That is why they are also known as double pointers or pointer to pointer. - 6 years agoHelpfull: Yes(6) No(0)
- 3. pointer to pointer
- 6 years agoHelpfull: Yes(2) No(0)
TCS Other Question