Pointers from data structures and algorithms

Pointers from data structures and algorithms

University

25 Qs

quiz-placeholder

Similar activities

Data Structures Quiz

Data Structures Quiz

University

20 Qs

FISIKA 2

FISIKA 2

10th Grade - University

25 Qs

web programming basics

web programming basics

University

20 Qs

Symposium Round 1

Symposium Round 1

University

30 Qs

Quiz Round For Group 2

Quiz Round For Group 2

University

20 Qs

Exploring Binary Trees in Java

Exploring Binary Trees in Java

University

20 Qs

Final Test

Final Test

University

20 Qs

Desarrollo Aplicacion Movil I

Desarrollo Aplicacion Movil I

University

20 Qs

Pointers from data structures and algorithms

Pointers from data structures and algorithms

Assessment

Quiz

Engineering

University

Hard

Created by

Keertipriya Bellary

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a pointer in C/C++ store?

Data value

Memory address

Variable name

Function name

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to access the value stored at the address a pointer points to?

&

*

%

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if you dereference a NULL pointer?

Program runs normally

Access violation error (segmentation fault)

Returns 0

Memory is allocated automatically

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In dynamic memory allocation, which function is used in C to allocate memory?

alloc()

malloc()

new

calloc()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a dangling pointer?

Pointer initialized to zero

Pointer that points to freed memory

Pointer pointing to a global variable

Pointer used for dynamic allocation

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you obtain the memory address of a variable in C?

Using * operator

Using & operator

Using → operator

Using % operator

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following snippet? int a = 10; int *p = &a; printf("%d", *p);

Address of a

Garbage value

10

Compile-time error

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?