MC answers needed please

Oct 20th, 2014
DotaCN
Category:
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?

*x

x

&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?

ptr

value (ptr)

* 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;

True

False

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

True

False

Question 10

1.  A pointer is passed by value to a function

True

False


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Duke University
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
kevin12622
Dec 5th, 2016
" Goes above and beyond expectations ! "
kiln82
Nov 26th, 2016
" awesome work thanks "
ashleyisgod
Nov 21st, 2016
" Top quality work from this guy! I'll be back! "
likeplum4
Nov 12th, 2016
" Excellent work as usual "
Molly_Moon
Oct 30th, 2016
" AMAZING as always! "
kpcutie
Oct 21st, 2016
" Excellent job "
Hemapathy
Oct 7th, 2016
" all I can say is wow very fast work, great work thanks "
pmallory
Sep 28th, 2016
" Totally impressed with results!! :-) "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1830 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