Sunday, July 15, 2007

Getting Started with C++

Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management.

Object oriented programming is essentially building a program around self-contained collections of data and code to modify that data; this programming model is in contrast to a model that uses function that act on data scattered throughout a program. Object-oriented programming (or coding, as programming is commonly referred to) is an organizational style, but it helps programmers create reusable code because the code to do a specific thing is entirely contained within a single section of code, and to use the code to perform tasks - for instance, creating a menu - involves using only a small number of functions to access the internals of the class.
Think of it as a black box that can be easily carried from place to place, and that performs complex actions simply at the press of a button: for instance, a microwave lets you heat food for a specified time limit - say, two minutes - by typing in the time and pressing the heat button. You do not need to know how the microwave operates or why the physics works. In the same way that self-contained appliances simplify life for the consumer, object-oriented programming simplifies the transfer of source code from one program to another program by encapsulating it - putting it all in one place.

In order to make usable programs in C or C++, you will need a compiler. A compiler converts source code - the actual instructions typed by the programmer - into an executable file. Numerous compilers are available for C and C++. Listed on the sidebar are several pages with information on specific compilers While reading a tutorial or a book, it is often helpful to type - not copy and paste (even if you can!) - the code into the compiler and run it.
Typing it yourself will help you to get used to the typical typing errors that cause problems and it will force you to pay attention to the details of programming syntax. Typing your program will also familiarize you with the general structure of programs and with the use of common commands. After running an example program - and after making certain that you understand how it works - you should experiment with it: play with the program and test your own ideas. By seeing which modifications cause problems and which sections of the code are most important to the function of the program, you should learn quite a bit about programming.
Improve google rankings all types of computer languages