Which of the following statements about pointers is true?Marks : 1Negative Marks : 0Answer herePointers are not used in C programming.Pointers cannot be assigned values directly.Pointers are variables that store the memory address of other variables.Pointers can only be used with integer data types.Clear
Question
Which of the following statements about pointers is true?Marks : 1Negative Marks : 0Answer herePointers are not used in C programming.Pointers cannot be assigned values directly.Pointers are variables that store the memory address of other variables.Pointers can only be used with integer data types.Clear
Solution
The true statement about pointers is: "Pointers are variables that store the memory address of other variables."
Here's why:
-
Pointers are indeed used in C programming. They are a powerful feature of the language that allows for dynamic memory allocation and efficient handling of arrays and structures.
-
Pointers can be assigned values directly, although this is typically done using the address-of operator (&) or through the use of functions like malloc() in C.
-
Pointers can be used with any data type, not just integers. You can have pointers to char, float, double, any user-defined types, or even other pointers.
Similar Questions
Which of the following statements about pointers is true?
Multi Choice Type QuestionWhat is the correct syntax for declaring a pointer variable?Marks : 1Negative Marks : 0Answer hereint *ptr;pointer int *ptr;*int ptr;None of the mentioned options
Multi Choice Type QuestionWhat does a null pointer indicate in C?Marks : 1Negative Marks : 0Answer hereA pointer that points to a constant valueAn uninitialized pointerA pointer with a value of zero (NULL)None of the mentioned options
What is the purpose of declaring a pointer variable in C?Marks : 1Negative Marks : 0Answer hereTo create a new variable.To store the address of another variable.To perform mathematical operations.All of the mentioned options
Which of these is a correct way to initialize a pointer in C?Marks : 1Negative Marks : 0Answer hereint ptr = 0int *ptr = 0int ptr = NULLint *ptr = NULL
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.