- AGarbage value
- B10
- C11
- DAddress of i
int x = &y;int *x = y;int &x = y;int *x = &y;
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
void func(int a)
{
}
void main()
{
void (*fp)(int);
fp=func;
fp(1);
}
Answer: D
Explanation: The correct way to declare a pointer to an integer variable in C is to use the * operator in the declaration, and assign the address of the variable using the & operator.
Answer: A
Explanation: A NULL pointer in C is a pointer that points to a non-existent memory location. It is typically used to indicate that a pointer does not currently point to a valid object.
Answer: B
Explanation: Pointer arithmetic in C involves performing arithmetic operations on the memory addresses stored in pointers. For example, you can add or subtract an integer value from a pointer to move it to a different memory location. However, it is important to be careful with pointer arithmetic to avoid accessing invalid memory locations.
Answer: C
Explanation: A double pointer in C is a pointer that points to another pointer. It is typically used for dynamic memory allocation, where the first pointer points to a dynamically allocated memory block and the second pointer points to a specific location within that block.
Answer: B
Explanation: A pointer to a function in C is a pointer that stores the address of a function in memory. You can use this pointer to call the function directly, without having to refer to it by name.