Tuesday, December 4, 2018

Structures and Unions & Memory Allocation

Halo guys gue abis belajar ini nihm nih gue jelasin yak

Apa itu struktur? nih arti struktur yg gue dapat dari bimay

Structure is a data type to store group of data with various of data type
syntax nya


Syntax
struct name_structure {
    dataType1 name_field1;
    dataType2 name_field2;
   
};


lanjut unions

Union is used for memory join. By using union, a memory location can be assigned for two or more variable with different data types


trus syntax

union  name_union{
     typedata1  name_var1 ;
     typedata2   name_var2;
     ……
} name_var_union;



memory


Memory Allocation as a data store:
1. static
    Ä can be assigned with name à variable
    Ä allocated at compile time
    Ä stored at local stack memory
    Ä remain unchanged during the program run
    Ä de-allocated when the program end
2. dynamic
    Ä can be assigned with name
    Ä allocated at run-time
    Ä stored at heap memory
    Ä can be de-allocated at any time


itu aja sih yg gue tankep maksihh

bimay sr

Wednesday, October 17, 2018

Repetition

Nama    : Andhika Ramadhan Putra
NIM     : 2201791351
Email    : andhika.putra005@binus.ac.id

Selamat pagi/siang/sore/malam, untuk yang membaca. minggu ini gue akan ngebahas tentang repetition di programing dev-c++ (bahasa c)

repetition kebagi menjadi 3 ada:
-for
-while
-do-while

//untuk for syntax nya begini
for(exp1;exp2;exp3){
statement1;
statement2;
}

//untuk while
while (exp){
statement1;
statement2;
}

//untuk do-while
do{
<statements>;
} while (exp){

}

ya intinya sih do while smaa while tuh berhubungan ehehe

ada juga break vs continues
bedanya kalo break itu untuk berentiin kalo continues untuk lanjutin looping.

summary:
repetition adalah kondisi dimana satu/lebih instruksi agar cepet (looping) kgk perlu atu2
ada 3 tipe data
for,while,do-while

sekian terima kasih.