Which Of The Following Is The Proper Declaration Of A Pointer Computer Science Homework Help

Question 1

  Which of thefollowing is the proper declaration of a pointer?

  A)  int p;

  B)  int &p;

C)  ptr p;

D)  int *p;

Question 2

  Which of thefollowing gives the memory address of integer variable x?

A)  *x

B)  x

C)  &x

D)  address (x)

Question 3

  What is wrong withthese statements:  int *ptr;  * ptr = 5;

A)  A pointer cannot pont to a type of integer

B)  *ptr = 5;  is not the right way to reference a pointerto update the value it is pointing to

C)  A pointer mustbe initialized to a valid address before referencing it

D)  There is nothingwrong with these statements, they will execute fine with no issues

Question 4

  Which of thefollowing provides the value stored at the address pointed to by the pointercalled ptr?

A)  ptr

B)  value (ptr)

C)  * ptr

D)  &ptr

Question 5

  Which statementdeclares and initializes a pointer to an address of a character?

A)  char char_ptr =&c;

B)  char *char_ptr =&c;

C)  both a and b

D)  none of theabove

Question 6

  When precedence isapplied, which is an equivalent statement to: i2 = *p1 / 2 + 10;

A)  i2 = ((*p1) / 2) + 10;

B)  i2 = (p1 * 2 ) +10;

C)  i2 = (*p1) / ( 2+ 10);

D)  none of theabove

Question 7

  Which is a validway to to reference a member called id_number of a structure using a pointer toa structure variable named emp_ptr?

A) (*emp_ptr).id_number = 98401;

B)  emp_ptr ->id_number = 98401;

C)  Both a and b

D)  none of theabove

Question 8

  C has a specificpointer type, such as:  pointer int_ptr;

A)  True

B)  False

Question 9

  A properlydeclared pointer in C can reference any element of an array, assuming thepointer is declared to point to same type as the array type

A)  True

B)  False

Question 10

  A pointer ispassed by value to a function

A)  True

B)  False

No matter what kind of paper writing service you need, we’ll get it written. Place Your Order Now!
× How can I help you?