en:cs:cpp:common:function
Differences
This shows you the differences between two versions of the page.
en:cs:cpp:common:function [2025/05/02 23:03] – created ulascemh | en:cs:cpp:common:function [2025/05/02 23:07] (current) – ulascemh | ||
---|---|---|---|
Line 27: | Line 27: | ||
==== Invocation by Reference ==== | ==== Invocation by Reference ==== | ||
- | If you need to refresh your knowledge about references, [[en:cs: | + | If you need to refresh your knowledge about references, [[en: |
Class types in the standard library are not suitable for calling by value. Because these types are costly to copy. | Class types in the standard library are not suitable for calling by value. Because these types are costly to copy. | ||
Line 68: | Line 68: | ||
{ | { | ||
int x { 5 }; | int x { 5 }; | ||
- | |||
std::cout << "value = " << x << ' | std::cout << "value = " << x << ' | ||
- | |||
addOne(x); | addOne(x); | ||
- | |||
std::cout << "value = " << x << ' | std::cout << "value = " << x << ' | ||
- | |||
return 0; | return 0; | ||
} | } |
en/cs/cpp/common/function.1746227005.txt.gz · Last modified: 2025/05/02 23:03 by ulascemh