One of the hardest concepts in the C programming language for me is Pointers. To this day I still often have to look into my text books when I’m diving deep into pointer world. Hopefully this tutorial will help demystify pointers for you.

What are Pointers?
Pointers got their name for one reason: they “point” to locations in memory. Pointers are just variables that store memory addresses, usually the addresses of other variables. With this memory address you’ll then be able to go to that address and retrieve the data stored in it. If you happen to have a large of data that you want to pass into a function it’s a lot easier to pass its location to the function than to copy every element of the data.

Read the rest of this entry »

Debugging is twice as hard as writing code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. - Brian Kernighan

If you’ve been programming for any length of time I’m sure at one time you’ve had the pleasure (or lack thereof) of wading through another persons code. It is definitely not a pleasurable journey when the code is new, written with the newest standards; but when the code is legacy it can be a downright hair-pulling experience.
Read the rest of this entry »

You have now learned how to write your first c program as well as the different loops in the c language so its now time to learn about functions. In general, functions are blocks of code that perform pre-defined commands to accomplish a certain task. You can either use the built-in functions included in the library or user defined functions (ones you create).
Read the rest of this entry »

Hello, and welcome to my first C++ tutorial. I am also going to happily assume that this is your first c++ tutorial too. If not, I hope to improve your understanding of c++. I will attempt to do so as simple as humanly possible. Shall we get started then?

In order to make programs you will need something called a compiler. We will use g++. A compiler I have come to love. I use linux so it comes with my operating system. I am assuming you are using windows, so follow the rules from this website: G++.
Read the rest of this entry »

If you want to repeat the same blocks of code over and over you have two choices. Copy and paste each block or you can use a loop. In C there are three different types of loops: for, while, and do…while. Each of them has their own specific uses and syntax, and below I’ll explain all three.
Read the rest of this entry »

No matter what other people say, commenting source code is an art form. It takes finesse (and sometimes an English degree :P) to properly comment your code. Some people are under the mindset “if its code, it has to be commented with long detailed comments” while others take the total opposite and barely comment a single line, and when they do they just explain the obvious. Which mindset is best? Neither!
Read the rest of this entry »

Have you just started programming and saw the line #include <stdio.h>? Are you wondering what this so called “.h” file is and what it does and why it’s important? Well in the following article I’ll go into detail about what a header file is, what its purpose is and also the most common header files.
Read the rest of this entry »