Monday, January 28, 2013

Character Arrays in C++

This tutorial will show you how to use char (character) arrays in c++. In case you don't know, in the coding world there are strings of text, e.g.:

"Hello world!"

and these strings can be divided into arrays of characters:

'H' + 'e' + 'l' + 'l' + 'o' + ' ' + 'w' + 'o' + 'r' + 'l' + 'd' + '!'

Each character within a string, file, network packet, or etc. can easily be accessed individually if you use a character array:

charArray[0] == 'H'
charArray[1] == 'e'
etc...

In this tutorial, we will be making a program that will read an input file (which is expected to be a series of phone numbers separated by commas), go through each character in the file and make some changes, and then output the result to another file.

Wednesday, January 16, 2013

Simple File Manipulation in a Console Application with C++

The goal of this tutorial is to show you how to make a C++ console application that will read data from a file called "input.txt" that's formatted like this (with each new entry on its own line):

1234567
1234567
1234567

and output it to a file called "output.txt" that is formatted like this (standard CSV (Comma Separated Values) format, except with 25 columns per row maximum):

1234567,1234567,1234567,...(25 times)
1234567,1234567,1234567,...(25 times)
1234567,1234567,1234567,...(18 times)

Creating an Empty C++ Console Application in Visual Studio 2010

Assuming that you already have Visual Studio installed (if not, click here for a tutorial with help/instructions), you'll need to know how to set up an empty console application to start with. This tutorial will show you how to do that.

Tuesday, January 15, 2013

Visual Studio Express

If you want to create serious desktop programs (especially for Windows), I highly recommend that you use Visual Studio. Visual Studio is what is called an IDE, or in simple terms a application that you use to develop other applications with. With it you can write code in many popular Microsoft languages like c++ and C#.

This tutorial should help you pick the right version and get it installed.