contoh program ARRAY POINTER, C++
Contoh program C++ Pointer
// +--------------------------------------------------- +
// + ARRAY POINTER +
// +--------------------------------------------------- +
# include <iostream.h>
# include <conio.h>
void main ()
{
clrscr(); //Hapus layar
char *nama_hari[] = { "senin", "selasa", "rabu", "kamis", "jumat", "sabtu", "minggu" };
for (int i = 0; i < 7; i++)
cout << nama_hari [i] << endl;
}
// +--------------------------------------------------- +
// + ARRAY POINTER +
// +--------------------------------------------------- +
# include <iostream.h>
# include <conio.h>
void main ()
{
clrscr(); //Hapus layar
char *nama_hari[] = { "senin", "selasa", "rabu", "kamis", "jumat", "sabtu", "minggu" };
for (int i = 0; i < 7; i++)
cout << nama_hari [i] << endl;
}
0 komentar:
Post a Comment