#include <iostream.h>
#include <conio.h>
class Ucapan {
public :
Ucapan() { kata = "Hello, World!";}
Ucapan(char* kata_awal);
void cetak() { cout<< kata << endl;}
private :
char*kata;
};
Ucapan::Ucapan(char*kata_awal){
kata = kata_awal;
}
int main()
{ Ucapan kalimat, kalimat2("Wellcome to algorithms");
kalimat.cetak();
cout<<endl;
kalimat2.cetak();
getch ();
return 0;
}
Explanation:
The program above only to show the sentence by using char data type and use the variable word.
The program above only to show the sentence by using char data type and use the variable word.
0 komentar:
Posting Komentar