C Programming - Pointers

C Programming - Pointers

University

16 Qs

quiz-placeholder

Similar activities

2.4 - 2.6

2.4 - 2.6

University

15 Qs

L1 - Computer Networks

L1 - Computer Networks

University

13 Qs

DBC CHAPTER 3 - REVISION

DBC CHAPTER 3 - REVISION

University

15 Qs

Week 4

Week 4

University

15 Qs

Java Control and Loop -2

Java Control and Loop -2

University

20 Qs

Five Nights At Freddy's: Security Breach Quiz

Five Nights At Freddy's: Security Breach Quiz

KG - Professional Development

13 Qs

Firewall and Network Security

Firewall and Network Security

University

15 Qs

PBO Inheritance Episode 2

PBO Inheritance Episode 2

University

18 Qs

C Programming - Pointers

C Programming - Pointers

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Kweh Alan

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

The definition:

int *countPtr, count;

specifies that countPtr and count are of type int* —each is a pointer to an integer.

True

False

Answer explanation

Actually, count is an int, not a pointer to an int. The * applies only to countPtr and does not distribute to the other variable(s) in the definition.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

A pointer may be initialized to NULL, 0 or an address.

True

False

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Initializing a pointer to 0 is equivalent to initializing a pointer to NULL, but 0 is preferred.

True

False

Answer explanation

Actually, NULL is preferred because it highlights the fact that the variable is of a pointer type.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

The only integer that can be assigned directly to a pointer variable is 0.

True

False

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Initialize pointers to prevent unexpected results.

True

False

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Assuming the definitions

double d = 98.6;

double *dPtr;

the following statement assigns variable d’s address to the pointer variable dPtr:

dPtr = &d;

Variable dPtr is then said to “point to” d.

True

False

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

The unary indirection operator (*) returns the value of the object to which its pointer operand points. Using * in this manner is called ______________ a pointer.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers