aboutsummaryrefslogtreecommitdiff
path: root/raii/allocate.cpp
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-12-26 12:19:10 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2024-12-26 12:19:10 +0100
commit05b8b7d3239bc53955a8ec8e7d9991224c0fd917 (patch)
tree7056e26d635cefa7341b6cda9af3e8061f7e708b /raii/allocate.cpp
parentc5bedb79e7c808294e85ed6fbba9aae527cd2990 (diff)
downloadtaming-cpp-05b8b7d3239bc53955a8ec8e7d9991224c0fd917.tar.gz
taming-cpp-05b8b7d3239bc53955a8ec8e7d9991224c0fd917.zip
Added RAII
Diffstat (limited to 'raii/allocate.cpp')
-rw-r--r--raii/allocate.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/raii/allocate.cpp b/raii/allocate.cpp
new file mode 100644
index 0000000..519f09f
--- /dev/null
+++ b/raii/allocate.cpp
@@ -0,0 +1,8 @@
1bool f(int big_number) {
2 int *a = new int[big_number];
3 return true;
4}
5
6int main() {
7 return 0;
8}

Generated with cgit - Back to sebastiano.tronto.net