Posts

Showing posts from October, 2018

Pointer and Array

Pointer What is Pointer? Pointer is a variable that store the value of another variable. Basically, a pointer isvariable that points at another variable when it is called, hence the name "Pointer". How to use it? It's rather easy to use pointer. int a; int *pointer; *pointer = &a; Notice the difference? that's right a pointer use '*' before the variable and the designated variable needs '&' as it is a symbol for the address of a variable. "But can i point a pointer using a pointer?" Well folks you're in luck because fortunately we could point a pointer with another pointer.   int a; int *pointer; int **point; *pointer = &a; **point = &pointer; to point another pointer we could just put another '*' behind the variable but wait, WHAT'S THE LIMIT? My friend, the limit is your imagination so use as many pointers as you want Array What is an Array?   Array is structures of ...

Algorithm Programming - Repetition

REPETITION           As a programmer when writing a program you may encounter problems where you need to run a block several number of times. Generally, programs run codes in order from top to bottom or sequentially; first line then second line and so on, this is where Repetition shines the brightest What is a repetition?           Repetition also known as looping is a type of function that repeats a single or more block of codes several number of times. To simplify it we could also say repetition in programming is the same as things we do in our daily routine e.g eating, showering etc. There are 4 kinds of repetition: 1. For 2. While 3. Do...While 4. Nested loop What we'll be learning this time is For loop. What is For loop?          For is used for repeating certain tasks in a specific number of times. the structure of For is as fol...