JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
Week 6 Quiz
Sign in to Google
to save your progress.
Learn more
This week we looked at another new thing in C - pointers. What type of value can a pointer hold?
Value of a variable
Address of a variable
Data type of a variable
Size of a variable
Clear selection
There are many different types of pointers. Which of the following is not a valid type of pointer?
integer pointer
float pointer
character pointer
All of the above are valid pointers
Clear selection
What would be the appropriate way to declare an integer pointer?
int a;
int *a;
int ptr a;
int &a;
Clear selection
What would be the appropriate way to assign an address to an integer pointer?
Assume a, the integer pointer has already been declared. b is the integer with the address we're using for this operation.
a = b;
a = *b;
*a = &b
a = &b
Clear selection
Which of the following is the appropriate way to de-reference a pointer?
De-referencing a pointer also mean that we're getting the pointer to return the value of the variable that it is pointing to.
a
*a
&a
*&a
Clear selection
By passing pointers as function parameters, we can have more than one "return value". Under which circumstances is this statement not in effect?
Assume pointer is not used in any other operations besides those described below.
Pointer is assigned another address in function
Computations were performed to de-referenced value of pointer
A new value was assigned to a de-referenced pointer
All of the above will ensure that pointer will change the value of the variable that it is pointing to
Clear selection
Image 1
Image 1 above shows the use of a pointer for taking user inputs. Is there anything wrong with the code in the image?
Assume pointer is not used in any other operations besides those described below.
The address operator "&" that should be in front of pointer in the scanf statement is missing
The wrong format specifier is used. %p should be used instead
Nothing is wrong
There is a syntax error in the code
Clear selection
Next
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. -
Terms of Service
-
Privacy Policy
Does this form look suspicious?
Report
Forms
Help and feedback
Contact form owner
Help Forms improve
Report