Перейти к основному содержанию
Zoro
Вопросы
Таймер
Резервное копирование
Главная
/
♾️ C++
/
Вопросы 43
C++:
What is the difference between stack and heap?
🎯
Режим фокуса
43
♾️
C++
🌱 junior
Снять отметку
What is the difference between stack and heap?
Stack
— automatic.
Heap
— manual.
cpp
Копировать
1
void
f
(
)
{
2
int
x
=
10
;
// Stack
3
int
*
p
=
new
int
;
// Heap
4
}
Stack — automatic cleanup.
Heap — manual cleanup.
Больше вопросов по C++
What is C++ and what is it used for?
What are the main differences between C and C++?
What is the difference between struct and class in C++?
What are pointers and references in C++?
What is the difference between new and malloc?
What is the difference between new and malloc?
What is RAII?
Назад к категории C++