Posts Tagged ‘C’

Algoritma Pemrograman & Struktur Data : Linked List

April 16, 2012

Kali ini kita akan mendiskusikan tentang struktur data ‘Linked List’. Silahkan unduh materi studi disini.

Advertisements

Algoritma Pemrograman & Struktur Data : Stack

April 16, 2012

Stack atau tumpukan adalah sebuah struktur data dimana data hanya dapat diisi atau dimasukkan dan diambil dari satu sisi saja. Stack bersifat LIFO (Last In First Out). Berikut materi tentang ‘Stack’ bisa diunduh disini.

Algoritma Pemrograman & Struktur Data : Pointer

April 15, 2012

Kali ini kita akan mendiskusikan tentang Pointer. Untuk materi silahkan unduh disini.

Contoh kode program C++ yang menggunakan ‘pointer’.

#include<iostream>
using namespace std;

int main()
{
int a = 50; // initialize integer variable a
cout<<“Value of ‘a’ = “<<a<<endl; // show the output of a
cout<<“Memory address of ‘a’: “<<&a<<endl; // show the address of a
cout<<endl;

int * b; // declare an integer pointer b
b = &a; // transfer the address of ‘a’ to pointer ‘b’
cout<<“Value of Pointer ‘b’: “<<*b<<endl; // show the output of *b
cout<<“Content of Pointer ‘b’: “<<b<<endl; // show the content of *b
cout<<“Memory address of Pointer ‘b’: “<<&b<<endl; // show the address of *b
cout<<endl;

int **c; // declare an integer pointer to a pointer
c = &b; // transfer the address of ‘b’ to ‘c’
cout<<“Value of Pointer ‘c’: “<<**c<<endl; // show the output of **c
cout<<“Content of Pointer ‘c’: “<<c<<endl; // show the content of **c
cout<<“Memory address of Pointer ‘c’: “<<&c<<endl; // show the address of **c
cout<<endl;
return 0;
}

 

Week #4 Basic Programming : Looping

April 2, 2011

In this week (#4), we will discuss about ‘Looping’. Here you can download the pdf file.