Archive for August, 2007

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).
(more…)

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++.
(more…)

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.
(more…)

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!
(more…)

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.
(more…)

So, you want to be able to write C programs? Well, you have come to the right place. Over the next few weeks I’ll be writing a series of tutorials called “The Basics”. Each one of these tutorials will cover a different subject that will help you learn how to program in C. In this weeks tutorial I’ll teach you how to write your first C program.
(more…)

I honestly can’t recall the number of times I’ve been asked what the difference was between arrays and linked lists. There’s been countless times when people have come up to me and asked “When should I use arrays and when should I use linked lists?” Since I’m getting tired of answering this so many times I felt I should write down my answer here :P
(more…)