diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-08-08 22:44:15 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-08-08 22:44:15 +0200 |
commit | 22675cd8dc75d8b8d4b0f818f5b093efbc364802 (patch) | |
tree | 90156d37dccf13f012d535e7d92273259e3d5c17 /Passing a pointer to heap data as an argument to a function transfers its ownership.md | |
parent | 295b343aecf330e830d79f06e0efc511e7d76da1 (diff) |
Diffstat (limited to 'Passing a pointer to heap data as an argument to a function transfers its ownership.md')
-rw-r--r-- | Passing a pointer to heap data as an argument to a function transfers its ownership.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Passing a pointer to heap data as an argument to a function transfers its ownership.md b/Passing a pointer to heap data as an argument to a function transfers its ownership.md new file mode 100644 index 0000000..754f141 --- /dev/null +++ b/Passing a pointer to heap data as an argument to a function transfers its ownership.md @@ -0,0 +1 @@ +Passing a variable into a parameter of a function is basically an assignment. So if we pass a pointer to heap data to a function the [[Moved heap data principle]] states that ownership is passed to that function. Thus the original variable can not be used anymore, for example after the function returns.
\ No newline at end of file |