Fatihul Ulum Community of Knowledge
Would you like to react to this message? Create an account in a few clicks or log in to continue.

pass by reference

Go down

pass by reference Empty pass by reference

Post  zz Tue Feb 24, 2009 5:44 pm

#include "iostream"
int milan (int &x) //perhatikan "&"
{
using namespace std;//gaya baru oi
x=x+5;
cout <<" mekkah adalah : " << x << endl;
}

int main ()
{
int mekkah =5;//memperkenalkan mekkah dengan nilai 5
milan (mekkah);//memanggil fungsi milan dan mengisinya dengan mekkah
return 0;
}
zz
zz
Panglima
Panglima

Jumlah posting : 121
Age : 78
Lokasi : france
Registration date : 13.02.09

Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik