MC answers needed please

Oct 20th, 2014
Computer Science
Price: $5 USD

Question description

Question 1

1.  Which of the following is the proper declaration of a pointer?

int p;

int &p;

ptr p;

int *p;

Question 2

1.  Which of the following gives the memory address of integer variable x?




address (x)

Question 3

1.  What is wrong with these statements:   int *ptr;   * ptr = 5;

A pointer can not pont to a type of integer

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

A pointer must be initialized to a valid address before referencing it

The statements are correct as is

Question 4

1.  Which of the following provides the value stored at the address pointed to by the pointer called ptr?


value (ptr)

* ptr


Question 5

1.  Which statement declares and initializes a pointer to a character?

char char_ptr = &c;

char *char_ptr = &c;

both a and b

none of the above

Question 6

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

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

i2 = (p1 * 2 ) + 10;

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

none of the above

Question 7

1.  Which is a valid way to to reference a member of a structure using the pointer variable emp_ptr?

(*emp_ptr).id_number = 98401;

emp_ptr -> id_number = 98401;

Both a and b

none of the above

Question 8

1.  C has a specific pointer type, such as:  pointer int_ptr;



Question 9

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



Question 10

1.  A pointer is passed by value to a function



Tutor Answer

(Top Tutor) Daniel C.
School: Duke University

Studypool has helped 1,244,100 students

Review from our student for this Answer

Oct 22nd, 2014
"Thanks, good work"
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1822 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors