Question: Which of the following statements creates a pointer variable p and initialises it to the address of an integer x? a. int * p =

 Which of the following statements creates a pointer variable p and

Which of the following statements creates a pointer variable p and initialises it to the address of an integer x? a. int * p = &x: b. int & p = &x: c. int% p = &x: d. int&p = *x: e. None of the above. Which of the following statements about pointer initialization is true a. Pointers can only point to constants b. Pointers can only be initialized to null pointers c. The data variable must be declared before it can be used for pointer initialization. d. Pointers are automatically set to null by the compiler. e. To initialize a pointer to the address of a variable, the variable's identifier is suffixed with the indirection operator(*) Which of the following statements declares a function with a pointer variable as a parameter? a. void fun (int ptr): b. void fun (&int ptr): c. void fun (int ptr): d. void fun (int& ptr): e. void fun (int* ptr): Which of the following statements passes a pointer to a variable to a function? a. fun (&x): b. fun (*x): c. fun (int &x): d. fun (int* x): e. fun (int *x): Which of the following statements about pointer use in functions is false? a. Passing a pointer to a function allows the function to change the value in the called function. b. Pointers can only be passed: they cannot be returned c. To pass an address from the calling function we use the ampersand operator (&) in the call d. To change the value of the data in the calling function, we use the asterisk operator (*) in the called function. e. Passing pointers to a function allows upward communication

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!