Kuis Pointer 1

Quiz
•
Information Technology (IT)
•
University
•
Hard
089_Gradiva undefined
Used 2+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
void modify(int*& ptr) {
int local = 20;
ptr = &local;
}
int main() {
int x = 10;
int* p = &x;
modify(p);
cout << *p << endl; // Apa hasil ini?
}
20
10
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int main() {
int arr[] = {10, 20, 30, 40};
int* p = arr + 2;
cout << (p++) << " " << (++p) << endl; // Apa hasil ini?
}
30 40
40 30
30 (angka acak)
40 (angka acak)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int main() {
int* p = nullptr;
if (p)
cout << "Not null";
else
cout << "Null";
}
Not null
Null
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int main() {
int a = 10;
int* p1 = &a;
int*& ref = p1;
int b = 20;
ref = &b;
cout << p1 << " " << ref << endl;
}
20 10
10 10
10 20
20 20
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int main() {
int x = 10;
int* p = &x;
delete p;
cout << x << endl;
}
10
Compile error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int main() {
int arr[] = {1, 2, 3, 4, 5};
int* p = arr + 4;
cout << *(p - 2) << endl;
}
2
3
4
Undefined (nilai gajelas)
Similar Resources on Wayground
10 questions
Diagnóstico PE MAY-AGO 2025

Quiz
•
University
10 questions
SWE111_quiz 2

Quiz
•
University
10 questions
Operasi Input & Output C++

Quiz
•
University
8 questions
Estruturas de Repetição - Parte 1

Quiz
•
University
10 questions
3F_14042025_Verifica per orale Informatica

Quiz
•
11th Grade - University
10 questions
Abstracciones procedimentales

Quiz
•
University
10 questions
Quiz Meet 2 Mini SC Programing

Quiz
•
University
8 questions
Lab 4

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade