How to reverse variable array using pointer to pointer in C++

Pointer to pointer is an reference that contain another pointer memory address. Remember, the reason it’s called pointer because it’s just pointing to another place that have “value”. Pointer is different with pointer to pointer. This is the simple explanation: 123456789101112131415#include<iostream> #include<str using namespace std; int main() {     int customer = 1;   [...]

How to counting array size and total element in C++

Array in C++ is just same as variables that organized into one place. Basically, each element in array just stored sequentially in memory. To get the length of array, it just simple by get the size of array and divided it by the data type size. Since the way array stored the value sequentially, then [...]

Implementation of User-Defined data using Struct in C++

There are two kind group of data type that needed to reserve amount memory, primitive data and user-defined data. Primitive data just like Int (4 byte), Char (1 byte), Double (8 byte) and so on. But what about we construct our custom data types, like a new data type that contains Int and Char? Then [...]

How to doing memory debugging and profiling in C with Valgrind

When we playing with C, memory debugging and profiling is a basic need to “break” and doing “analysis” to our C program. Valgrind is a good tools to help us doing memory debugging and profiling. In this case, I use Ubuntu 12.04. First, we need to install Valgrind by : 1sudo apt-get install valgrind Next, [...]

Using SublimeText for compiling and runing individual cpp files

I prefer using SublimeText 2 for running individual files rather Eclipse. It’s pretty easy and quick. First, you need to download SublimeText 2 and install it your system. Then second step, make sure you have G++ already installed in your system. Ready to go? First, let we create some helloworld.cpp files from SublimeText 2: 1234567#include [...]

Showing ASCII number of alphabet letter in C

To create string in C, we commony we use char. For example : 1char alphabet = "a" At this point, char in C basically represents a byte. So yes, “a” equal with one byte. Just remember, everything you see char in C it’s mean byte. Another things we should know is string structure in C [...]

Learning how to print Fibonacci number in C

Fibonacci number in mathematical terms can be used for learning any programming languange. Now, we will learn how to print Fibonacci number in console using C. First thingsp, create a file called “fibonacci.c” :

How to print hello world in C on Ubuntu Linux

The first things to do learning C programming language is create a “Hello World!”. I commonly use Ubuntu / LINUX for building application. So, at tthis blog, I will write all C applicationsĀ  in Ubuntu. Let’s start by creating a file called “helloworld.c” :