Skip to main content

Posts

Showing posts from October, 2018

Pointer and Array

Pointer and Array Meaning of Pointer A variable that store the address of another variable Two operators mostly used in pointer : ·          * ( Content of ) So the (*) symbol in (*ptr) for example is used to point the content in ptr variable ·          & ( Address of ) The (&) symbol in (ptr = &x) is used to show where the x   address is Pointer to Pointer (**) A variable that saves another address of a pointer So when the second pointer get the address of the first pointer using the (&) symbol, it ( the second pointer ) can point the content of that address using the (**) symbol. Meaning of Array A series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier •        Syntax:        ...

Algorithm and Programming : Repetition

Repetition Program Control : Repetition Meaning of Repetition Instruksi yang digunakan berulang selama waktu tertentu ( memiliki batas tertentu ). Batas dari pengulangan bisa ditentukan. Kind of Repetition : Repetition : For    Syntax  for(exp1; exp2; exp3) {   statement1;...  } exp1 :  initialization exp2 :  conditional exp3 :  increment or decrement exp1, exp2 and exp3 are optional Infinite Loop Loop yang tidak memiliki kondisi untuk berhenti.  Untuk membuat loop berhenti adalah dengan menggunakan BREAK; Nested Loop Memiliki Loop didalam Loop. Dan loop yang dimulai adalah Loop yang didalam. Repetition : While Statement akan dilakukan setelah kondisi yang ditetapkan sudah benar.    Syntax  while(exp){    statement1;            exp :  conditional Repetition :...