C Programming - Pointers

C Programming - Pointers

University

16 Qs

quiz-placeholder

Similar activities

Input Device

Input Device

University

15 Qs

Linux 3-4

Linux 3-4

University

20 Qs

PSC Quiz1

PSC Quiz1

University - Professional Development

20 Qs

Quiz 2

Quiz 2

University

12 Qs

Data Structures

Data Structures

University

20 Qs

Algo Duel

Algo Duel

University

20 Qs

Quiz - Linked list

Quiz - Linked list

University

14 Qs

PIC2 Class Test - 3(Unit-3) dt-10-06-2021 By DrARD

PIC2 Class Test - 3(Unit-3) dt-10-06-2021 By DrARD

University

20 Qs

C Programming - Pointers

C Programming - Pointers

Assessment

Quiz

Computers

University

Medium

Created by

Kweh Alan

Used 5+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?