C++ Tutorial
TABLE OF CONTENTS
    Introduction
  1. Getting Started
  2. The history of C++
  3. Other Resources
    Chapter 1: Fundamentals
  1. Variables and built-in data types
  2. Operators
  3. Constructs
  4. Function basics
  5. C++ program schematics
    Chapter 2: Programming in C++
  1. Arrays
  2. Structures
  3. Pointers
  4. File I/O
  5. Algorithms
  6. Practical Applications
    Chapter 3: Classes
  1. Object Oriented Programming
  2. Constructors and Destructors
  3. Encapsulation and Inheritance
  4. Multiple Inheritance and Polymorphism
  5. Designing libraries
    Chapter 4: Advanced C++ Programming
  1. Opperator Overloading
  2. Templates
  3. Exception Handling
    Chapter 5: Windows Programming
  1. How Windows works
  2. Programming Windows in C (Windows API)
  3. Introduction to the OWL (Borland)
  4. Introduction to the MFC (Microsoft)
    Chapter 6: Advanced Applications
  1. Introduction to Assembler programming
  2. Low level graphics programming (DOS 13h)
  3. High level graphics programming (Direct X)
  4. Computer game programming

GETTING STARTED

This tutorial will give you a fairly comprehensive understanding of C++. What you don't learn in this tutorial (which won't be much) will be easy to tackle after completion. This is a bold statement, but I'm determined to show you that programming isn't as complex as people make it out to be.

We're going to start with the basics of C++ programming, which also apply to any other area of programming. No previous programming knowlege is required, although a good understanding of at least second year high school Algebra and Trigonometry is recommended.

To take full advantage of this tutorial, you'll need a C++ compiler. Unfortunately, I don't know of any shareware or freeware C++ compilers currently available, so I would recommend buying a commercial compiler. I use Borland C++ 4.5, and am very happy with it. I also recommend Borland C++ 5.0 (although I've heard its "buggy") and Visual C++ 2.0 or 4.0 (there's no 3.0). Another option is Borland Turbo C++, which is fairly inexpensive, but its a DOS compiler, so when we get into windows programming you might be lacking some essentials. If you're a student at a college or university where software is sold, check there first. You can usually find software for 50-75% less than what it would be at retail value. If this opportunity isn't available, then look around on the internet or in the thrifties for some used software. If all else fails, you can always buy them at your local software store, but it will cost you a pretty penny! (anywhere from $150 to $400)


THE HISTORY OF C++

C++ has its roots back in the sixties when Brian Kernigham and Denis Ritchie developed the C programming language at AT&T Bell Labs, which was used for creating the popular operating system, UNIX. C increased in popularity over the years following its creation, attracting legions of programmers. But C had its limits. Large programs became impossible to manage because of the way it is set up, and if not written properly, C code could be deadly to a business.

In the early eighties, Bjarne Stroustrup designed the C++ programming language at AT&T Bell Labs. C++ was an improvement over C in many ways, but the biggest was its ability to manage completely new types of data--the class. C++ was originally called "C with Classes", but as new features were added to the standard, it was becomming a higher level of C rather than C with a "bonus feature". The abilities of C++ to so efficiently manage data would be invaluable to large comanies working with teams of programmers on software applications rather than one individual programmer. C++ took programming to a higher level called Object Oriented Programming. And although C++ isn't the first object oriented programming language, it is the first to achieve the level of popularity that is has today.

C++ is not finalized as a programming language yet. A standards commitee consiting of representives of major software developers, programming experts, and the creators of the language was assembled to standardize the programming language. The ANSI commitee is what makes compiler independant tutorials like this one available. It makes little difference what compiler you have; C++ is fairly uniform, which makes the job of learning it a lot easier.


OTHER RESOURCES

If you're serious about learning C++, then you've come to the right place. If you want to make some money with what you know about C++, however, then you'll have to do some outside reading. Knowing a language isn't enough to earn money or do something important in the real world. A non-programmer doesn't give a flying flip that you know C++. What they care about is if you can do something for them. Your everyday people want databases, day planners, drawing applications, games, diagnostic utilities; and you have to get training to know how to program these. There are so many applications to what you can do with C++ once you know it, and knowing it is only the first step. Once you know the language, you have to educate yourself in an area of programming that applies to what you want to program. If you're planning on making games once you learn C++, then you need to ask yourself "what kind of game?". Get some information on what kind of game you want to make. If you're going to make a flight simulator, get a book on creating a flight simulator, and some information on 3D programming with polygons, shading, etc. A system diagnostics utility requires an in-depth understanding of the underlying system, and that knowlege does not come with learning a programming language.

I have three suggestions for your programming endeavors.

1. Invest in some books. In my book review section I review all the programming books I have read, so check there for starters. If you feel you have a good understanding of C++ after reading this tutorial, then focus on what you want to program instead of learning how to program. If you're fuzzy on some stuff, then buy a good book on the C++ programming language (the one by that title wouldn't be a bad choice) to ensure you wont get lost in applying your experience. Buy several books that cover the area of programming that you are interested in. There are great books available for DOS and Windows game programming, books about the internal workings of computers, and books on application development. Another great book choice would be a general book on programming algorithms that isn't nessessarily geared for C++.

2. Subscribe to some programming-related internet newsgroups and [old fashioned paper] magazines. Internet newsgroups are a great place to post questions and have them answered by experienced programmers. If you're on an online service that provides local programming message boards, such as America Online or Compuserve, then check in to those as well. Attempt to answer some questions as well, possibly doing some research to accomplish this. Magazines such as "Windows Developers Journal" or "C/C++ Users Journal" also provide excellent resources for more abitious programmers. The most used newgroup for C++ programming is comp.lang.c++, and there are many professionals that post messages there. Be forwarned, however, that there can be 500 or more messages posted a day in this newsgroup, so it can be difficult to find a response to your question amongst the other messages!

3. Find someone whom you can ask programming questions of, preferably someone who is interested in programming in the same area you are. For instance, many games are developed by groups of programmers of the same language who have a common interest in a particular style of game; you may consider finding such a group and joining them. There are many programming consultants online that would be happy to answer any questions you may have, and some others are simply available to answer general questions. I can answer specific questions, but I often do not have the time to explain long concepts--this is why I'm writing these tutorials! :) Its not difficult to find someone who can help you. There are many people using the USENET newsgroups that can answer your questions, or someone with a programming web page. At any rate, it would be a good idea to find a personal consultant (so to speak) who can help you with any problems you might have and explain concepts to you.


From here you should start chapter 1 of the tutorial, which introduces fundamental concepts of programming in C++. Good luck!

Go to the next section: C++ Fundamentals


This page was last updated on 7-15-97
Hosted by Geocities 1