diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-26 12:19:10 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-26 12:19:10 +0100 |
| commit | 05b8b7d3239bc53955a8ec8e7d9991224c0fd917 (patch) | |
| tree | 7056e26d635cefa7341b6cda9af3e8061f7e708b /raii/allocate.cpp | |
| parent | c5bedb79e7c808294e85ed6fbba9aae527cd2990 (diff) | |
| download | taming-cpp-05b8b7d3239bc53955a8ec8e7d9991224c0fd917.tar.gz taming-cpp-05b8b7d3239bc53955a8ec8e7d9991224c0fd917.zip | |
Added RAII
Diffstat (limited to 'raii/allocate.cpp')
| -rw-r--r-- | raii/allocate.cpp | 8 |
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 @@ | |||
| 1 | bool f(int big_number) { | ||
| 2 | int *a = new int[big_number]; | ||
| 3 | return true; | ||
| 4 | } | ||
| 5 | |||
| 6 | int main() { | ||
| 7 | return 0; | ||
| 8 | } | ||
