Poi Nter Si MPL e
Poi Nter Si MPL e
#include <stdio>
#include <conio>
#include <iostream>
main ()
{
int satu;
int *lokasi,value;
satu=5;
lokasi=&satu;
value=*lokasi;
cout << "satu = " << satu << endl;
cout << "lokasi = " << lokasi <<
endl;
cout << "value = " << value << endl;
getch();
}
andy = 25;
fred = andy;
ted = &andy;
andy = 25;
fred = andy;
ted = &andy;
beth = *ted;
char a;
char * b;
char ** c;
a = 'z';
b = &a;
c = &b;
Lokal or
internal
Statement
Functi on gl obal n l okal
n val ue in function
#include <stdio> //Statement global
#include <conio> cout << "The begin = " << z << '\n';
#include <iostream> x=10,y=3;
int kurang(int a, int b=8) z = kurang(7,2);
{ cout << "The first = " << z << '\n';
int r; cout << "The second = " << kurang (x,y) << '\n';
r=a-b; cout << "The third = " << kurang (5,4) << '\n';
return (r); z= 9 + kurang(x,y);
} cout << "The fourth = " << z << '\n';
//deklarasi global getch();
int x,y,z=9; }
main ()
{
Functi on b y Val ue n Ref erence
#include <stdio>
#include <conio>
#include <iostream>
// by value or satu arah
//tidak ada nilainya
perkalian_value (int a, int b, int c)
{
a*=2;
b*=2;
c*=2;
}
int main ()
{
int x=5,y=2;
float n=8.8,m=1.1;
cout << " "<<itung (x,y);
cout << "\n";
cout << " "<<itung (n,m);
cout << "\n";
getch();
}
Tugas Searching I nl ine Fun cti on
Kirim ke
tugasaye@gmai l.co m