Telegram Group & Telegram Channel
#الدوال
الدوال التي لا ترجع قيمه :

_دائما ما يكون نوعها هو void وهي لا تحجز اماكن في الذاكره الا وفقط للمتغيرات التي بداخلها فقط

_لا تحتوي هذه الدوال على قيم عند كتابه الامر return

_يعتبر الامر return في هذه الدوال امرا لايقافها بمعني ان الداله تنتهي عند هذا الكود

_غالبا ما تستخدم هذه الدوال لاداء وظائف الطباعه والاخراج او وظائف الكتابة والتعديل على المتغيرات العامه في البرنامج

_تستخدم ايضا غالبا كدوال #الاستدعاء_بالمرجع او #call_by_reference للكتابه والتعديل على قيم المتغيرات الممره فيها


امثلة :

1-لا تستقبل قيما
void say_hello()
{
cout<<"\tHello Sir \n";
}
تقوم هذه الداله بطباعه النص (Hello Sir) في كل مره يتم استدعائها فيه

2-تستقبل قيما
void say_welcome(string name)
{
cout<<"\tWellcome "<<name<<" to my project .\n";
}

تقوم هذه الداله بالترحيب بالشخص الممر اسمه فيها عند استدعائها مثلا
say_welcom("Ahmed");
والنتيجه هي طباعة
Welcome Ahmed to my project .

3-#الاستدعاء_بالمرجع
void Swap(int &a , int &b)
{
a ^= b;
b ^= a;
a ^= b;
}
تقوم هذه الداله بتبديل قيمتي المتغيران الذان يمرران اليها مثل

int num1 = 22 , num2 = 30;
cout<<"num1 = "<<num1<<" num2 = " <<num2<<endl;
Swap(num1 , num2);
cout<<"num1 = "<<num1<<" num2 = " <<num2<<endl;

والنتيجه هي :
num1 = 22 num2 = 30
num1 = 30 num2 = 22

#بالتوفيق_للجميع



tg-me.com/ComputerScienceCode/545
Create:
Last Update:

#الدوال
الدوال التي لا ترجع قيمه :

_دائما ما يكون نوعها هو void وهي لا تحجز اماكن في الذاكره الا وفقط للمتغيرات التي بداخلها فقط

_لا تحتوي هذه الدوال على قيم عند كتابه الامر return

_يعتبر الامر return في هذه الدوال امرا لايقافها بمعني ان الداله تنتهي عند هذا الكود

_غالبا ما تستخدم هذه الدوال لاداء وظائف الطباعه والاخراج او وظائف الكتابة والتعديل على المتغيرات العامه في البرنامج

_تستخدم ايضا غالبا كدوال #الاستدعاء_بالمرجع او #call_by_reference للكتابه والتعديل على قيم المتغيرات الممره فيها


امثلة :

1-لا تستقبل قيما
void say_hello()
{
cout<<"\tHello Sir \n";
}
تقوم هذه الداله بطباعه النص (Hello Sir) في كل مره يتم استدعائها فيه

2-تستقبل قيما
void say_welcome(string name)
{
cout<<"\tWellcome "<<name<<" to my project .\n";
}

تقوم هذه الداله بالترحيب بالشخص الممر اسمه فيها عند استدعائها مثلا
say_welcom("Ahmed");
والنتيجه هي طباعة
Welcome Ahmed to my project .

3-#الاستدعاء_بالمرجع
void Swap(int &a , int &b)
{
a ^= b;
b ^= a;
a ^= b;
}
تقوم هذه الداله بتبديل قيمتي المتغيران الذان يمرران اليها مثل

int num1 = 22 , num2 = 30;
cout<<"num1 = "<<num1<<" num2 = " <<num2<<endl;
Swap(num1 , num2);
cout<<"num1 = "<<num1<<" num2 = " <<num2<<endl;

والنتيجه هي :
num1 = 22 num2 = 30
num1 = 30 num2 = 22

#بالتوفيق_للجميع

BY علوم حاسوب CS.Code


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/ComputerScienceCode/545

View MORE
Open in Telegram


علوم حاسوب CS Code Telegram | DID YOU KNOW?

Date: |

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

علوم حاسوب CS Code from us


Telegram علوم حاسوب CS.Code
FROM USA