Question for C Programming

Oct 30th, 2014
DotaCN
Category:
Engineering
Price: $5 USD

Question description


Question 1



1. 
Dynamic Memory
Allocation that we studied this week happens at





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

Run Time


 

 


 


 

Compile Time


 

 


 


 

Play Time


 

 


 


 

None of the Above


 



Question 2



1. 
Which is proper way to
use a pointer to a structure to reference the wage member?





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

(*emp_ptr).wage


 

 


 


 

emp_ptr -> wage


 

 


 


 

Both the first two answers will do the same thing


 

 


 


 

None of the Above


 



Question 3



1. 
A structure
can have a member who is declared to be a pointer to some type in C



True



False



Question 4



1. 
Each item in a linked
list is referred to as a ...





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

node


 

 


 


 

link


 

 


 


 

value


 

 


 


 

handle


 



Question 5



1. 
Which is a false
statement about "malloc"





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

Is a function that is part of the C Library


 

 


 


 

Returned area in the heap is initialized to 0


 

 


 


 

returns 0 if unable to allocate memory in the heap


 

 


 


 

returns a pointer to the start of the area in the heap


 



 



Question 6



1. 
cfree is used to return back memory in the heap
allocated with the malloc statement



True



False



Question 7



1. 
Given that a is an
array name, and i is an index to that array:  Which is the basic rule that
suggests the relationship between pointer and arrays?





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

a [ i ] = ( * ( a + i ) )


 

 


 


 

i  = ( * ( a + i ) )


 

 


 


 

a [ i ] = * i


 

 


 


 

a [ i ] =  i


 



Question 8



1. 
Given:  char a[ ] = "0123456789"; and int i = 5; ... it is possible to
reference i [ a ] ?



True



False



Question 9



1. 
Which of the following
is the proper keyword or function to deallocate memory?





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

free


 

 


 


 

delete


 

 


 


 

clear


 

 


 


 

remove


 



Question 10



1. 
Which of the following
is the proper keyword or function to allocate memory in C?





 
 
 


 
 
 


 
 
 


 
 
 


 


 


 

new


 

 


 


 

malloc


 

 


 


 

create


 

 


 


 

value


 



Tutor Answer

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

Studypool has helped 1,244,100 students

Summary
Quality
Communication
On Time
Value
kevin12622
Feb 24th, 2017
" Goes above and beyond expectations ! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1823 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