عندما نعرف المتغيرات احيانا تستخدم if sream ومرات ofstream
ما الفرق؟
عندما نعرف المتغيرات احيانا تستخدم if sream ومرات ofstream
ما الفرق؟
السلام عليكم,
كل ما في الأمر وهو أن of تدل على out to file و io تدل على in from file .
واحدة للخروج وأخرى للدخول.
حد يفهمني الvoid function!!!!!!
بس لو تعطوني شرح عن هالموضووووع ~_~
السلام عليكم اخوي maithah ..
الفرق بين void function و function ثانية ان الvoid function ما تكتب فيها return اللي نكتبها في اي function ثانيه مثل int function float function .... etc
و علشان شذي تقدر تكتب بدال الreturn
cout في void function
مثال لل void function
#include <iostream>
void Displaymesseage ( int n); //declear function
using namespace std;
int main()
{
Displaymesseage(15); //function call
cout<< "good bye"<<endl;
return 0;
}
void Displaymesseage (int n) //function definition
{
cout<< " i have liked math for " <<" " << n<< "years"<<endl;
}
شو كتبنا cout و ما كتنبنا return لقيمة الداله
بس شو مثال value return function
#include <iostream>
using namespace std;
int max ( int a , int b , int c );
int main( )
{
cout << "The maximum of 12 , 90 and 60 is :"
<< max (12 , 90 , 60 ) <<endl;
return 0;
}
int max ( int a , int b , int c ) // Complete the following function
{
if ((a >b ) && (a > c))
return a;
else
if( b > c)
return b;
else
return c;
}
في النهاية ما كتبنا cout كتبنا return b; or return c;
ان شاء الله تكون الصوره و اضحه
تم تعديل هذه المشاركة بواسطة IT girl في 23 أكتوبر 2003 في 11:55
هذا الموضوع مغلق.