100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

CSE 240 Final ACTUAL Exam Questions and CORRECT Answers

Puntuación
-
Vendido
-
Páginas
28
Grado
A+
Subido en
20-08-2025
Escrito en
2025/2026

CSE 240 Final ACTUAL Exam Questions and CORRECT Answers If a function calls another function, the local variables in these two functions use the memory from - CORRECT ANSWER - different stack frames. Which C/C++ operations will acquire memory from heap? Select all that apply. - CORRECT ANSWER - - new - malloc You do not need to garbage-collect the memory, if it comes from (Select all that apply) - CORRECT ANSWER - - global memory

Mostrar más Leer menos
Institución
CSE 240
Grado
CSE 240










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CSE 240
Grado
CSE 240

Información del documento

Subido en
20 de agosto de 2025
Número de páginas
28
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Vista previa del contenido

CSE 240 Final ACTUAL Exam Questions
and CORRECT Answers
If a function calls another function, the local variables in these two functions use the memory
from - CORRECT ANSWER - different stack frames.


Which C/C++ operations will acquire memory from heap? Select all that apply. - CORRECT
ANSWER - - new
- malloc


You do not need to garbage-collect the memory, if it comes from (Select all that apply) -
CORRECT ANSWER - - global memory
- stack memory
- static memory


What is the key difference between a static variable and a global variable? - CORRECT
ANSWER - They have different visibility.


Given the snippet of code:
int x = 5;
int bar(int j)
{
int *k = 0, m = 5;
k = &m;
return (j+m);
}
void main(void)
{
static int i =0;

,i++;
i = bar(i) + x;
}
Which variables obtain their memory from the stack? Select all that apply. - CORRECT
ANSWER - k, m, j


What is the best way of deleting an array created by "p = new StructType[size];" in C++? -
CORRECT ANSWER - delete[] p;



What memory must be garbage-collected by a destructor? - CORRECT ANSWER - heap
memory created in the constructors in the same class


What is the best way of deleting a linked list of objects in C++? - CORRECT ANSWER - Use
a loop to delete every object in the linked list.


What is the best way of deleting all the nodes in a binary tree pointed to by the root pointer? -
CORRECT ANSWER - Traverse the tree and delete each node individually.


In the implementation of the getMax() function in the PriQueue class, we need to read and write
the variables "front" and "rear", which are defined as protected members in the base class Queue.
Are the functions in the derived class allowed to access the protected members in the base class?
- CORRECT ANSWER - Yes, always.


If a class needs to inherit from multiple parent classes, the parent classes must - CORRECT
ANSWER - be inherited as virtual classes.



Defining a virtual function in class means that the function - CORRECT ANSWER - can be
redefined in its child classes.

, If you declare a pointer to the object of the parent class and use the pointer to access the object of
a child class, you can access - CORRECT ANSWER - the members that exist in the parent
class.


Assume that Publication is the root class of an inheritance tree. You want to form a linked list of
different publications in the inheritance tree, including Book, Report, Newspaper, etc. What is
the best way to create a linked list using PublListNode and Publication classes? - CORRECT
ANSWER - The PublListNode class contains the Publication class.


What type casting mechanism should be used if you want to change pointer type for pointing to a
different object in an inheritance hierarchy? - CORRECT ANSWER - dynamic_cast


It does not cause memory (storage) overhead to create multiple - CORRECT ANSWER -
names (alias) for a variable.


Given the following snippet of C++ code:
string name = "Hello";
ofstream myFile;
myFile.open(myFile);
myFile << name;myFile.close();

What does it do? - CORRECT ANSWER - It saves the word Hello into a file in the file
system.


The exception handling mechanism discussed in this course is at the level of - CORRECT
ANSWER - user program.


A throw statement is associated with a specific exception handler through the - CORRECT
ANSWER - the data type implied by the throw value.


There are various consequences to not using the C++ built-in exception handling mechanisms.
Which of them is the most serious consequence? - CORRECT ANSWER - Not restoring the
stack pointer to its original position before entering the function.

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
MGRADES Stanford University
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1069
Miembro desde
1 año
Número de seguidores
102
Documentos
68976
Última venta
1 día hace
MGRADES (Stanford Top Brains)

Welcome to MGRADES Exams, practices and Study materials Just think of me as the plug you will refer to your friends Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

169 reseñas

5
73
4
30
3
44
2
8
1
14

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes