Forwarded from خاص بماده البـرمجه
🔤السلام عليكم
🌹طيب الله اوقاتكم 🌺
#محاضره_ اليوم _نظري
#المقارنه بين 👇🏼
~*A_passing by value and passing vu refrence.*~`
المقارنه
🛑The first passinge By Value
1⃣ *int x;*
2⃣ *The parameter x is local variable*
3⃣ *It is duplicate of the argument*
4⃣ *It cannot change the argument.*
5⃣ *The argument passed by value many be a constant, avariable, or an cxpression.*
6⃣ *The argument is read-only.*
_____
🛑 _*Second passing By Reference*_
1⃣ *int &x;*
2⃣ *The parameter x is local reference.*
3⃣ *It is synonym for the argument*
4⃣ *It can change the argument.*
5⃣ *The argument passed by reference must be avariable.*
6⃣ *The argument is read _write.*
💻برنامج لتبديل القيمه بين متغيرين بستخدام المؤشرات
#include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
int &p=a;
p++;
a++;
cout <<"p="<<p<<"\t";
p--;
a++;
cout<<"p="<<p;}
#منقول
عمل الاخ
صالح الشعيبي ❤️👍🌹
🌹طيب الله اوقاتكم 🌺
#محاضره_ اليوم _نظري
#المقارنه بين 👇🏼
~*A_passing by value and passing vu refrence.*~`
المقارنه
🛑The first passinge By Value
1⃣ *int x;*
2⃣ *The parameter x is local variable*
3⃣ *It is duplicate of the argument*
4⃣ *It cannot change the argument.*
5⃣ *The argument passed by value many be a constant, avariable, or an cxpression.*
6⃣ *The argument is read-only.*
_____
🛑 _*Second passing By Reference*_
1⃣ *int &x;*
2⃣ *The parameter x is local reference.*
3⃣ *It is synonym for the argument*
4⃣ *It can change the argument.*
5⃣ *The argument passed by reference must be avariable.*
6⃣ *The argument is read _write.*
💻برنامج لتبديل القيمه بين متغيرين بستخدام المؤشرات
#include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
int &p=a;
p++;
a++;
cout <<"p="<<p<<"\t";
p--;
a++;
cout<<"p="<<p;}
#منقول
عمل الاخ
صالح الشعيبي ❤️👍🌹