ECE431 - Pointer & Reference

ECE431 - Pointer & Reference

University

16 Qs

quiz-placeholder

Similar activities

Pointer dan Fungsi

Pointer dan Fungsi

University

14 Qs

AlgoProg - Review Quiz

AlgoProg - Review Quiz

University

20 Qs

Apuntadores C++

Apuntadores C++

University

11 Qs

Quiz 2 - Pointer and Function

Quiz 2 - Pointer and Function

University

11 Qs

Java Programming

Java Programming

University

20 Qs

Data Structure

Data Structure

University

14 Qs

Week 9 - Functions and Pointers

Week 9 - Functions and Pointers

University

14 Qs

Excel and Python

Excel and Python

7th Grade - University

20 Qs

ECE431 - Pointer & Reference

ECE431 - Pointer & Reference

Assessment

Quiz

Computers

University

Hard

Created by

Dr Zaini

Used 1+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does int* ptr = &num do?

Declares an integer

Stores the value of num

Declares a pointer to num

Assigns the value num to ptr

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If x = 5 and int* px = &x;
what does *px return?

5

Memory address of x

Error

Undefined value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the statement *mark = 40; do, if mark is a pointer to an integer?

Stores 40 in a new location

Changes the address mark is pointing to

Changes the value at the pointed location to 40

Causes a segmentation fault

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of: int score = 88; int* pScore = &score; *pScore = 90; cout << score;

88

90

Error

Address of score

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to declare a pointer?

&

*

%

^

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of &temp in int* p = &temp;?

Declare a new pointer

Get the value of temp

Get the address of temp

Initialize temp

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which line declares a reference / alias correctly?

int ref = *val;

int* ref = val;

int& ref = val;

int& ref = &val;

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?