Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 12
diff options
context:
space:
mode:
Commit048e9f8ef601d42e91b7ca7a46aa77a6e6626f27 (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2020-12-27 16:30:46 +0200
Committer
 GitHub <noreply@github.com>
2020-12-27 16:30:46 +0200
Files462a3522b5e8aa180d67f11cadded36bbedae7dd /Sem. 12
Introduction_to_programming_FMI-048e9f8ef601d42e91b7ca7a46aa77a6e6626f27.tar
Introduction_to_programming_FMI-048e9f8ef601d42e91b7ca7a46aa77a6e6626f27.tar.gz
Introduction_to_programming_FMI-048e9f8ef601d42e91b7ca7a46aa77a6e6626f27.zip
Parent58b0d4837854b9b0834e50a62706210492134651 (diff)
Create references.cpp
1 files changed, 22 insertions, 0 deletions
-rw-r--r--Sem. 12/references.cpp22
diff --git a/Sem. 12/references.cpp b/Sem. 12/references.cpp
new file mode 100644
index 0000000..5922d33
--- /dev/null
+++ b/Sem. 12/references.cpp
@@ -0,0 +1,22 @@
+#include <iostream>
+using namespace std;
+
+void f(int a)
+{
+ a += 5;
+
+}
+void f2(int& a)
+{
+ a += 5;
+}
+
+int main()
+{
+ int x = 10;
+ f(x);
+ cout << x << endl; //10
+
+ f2(x);
+ cout << x << endl; //15
+}