C++

This is a placeholder for Portal:Engineering and Technology School:Computer Science Topic:Computer Programming C++

Welcome to the C++ programming language. Whether you're not certain which language to pick or you've already decided on C++, you've come to the right place.

C++ is arguably the most versatile language in common use. C++ allows for both high-performance code as well as expressive abstractions and design constructs. The language is not perfect but it does represent an excellent compromise between these potentially conflicting language capabilities. C++ combines "low-level" programming tailored to specific machine architectures with "high-level" programming, which can allow code to be completely abstracted from any particulars of the machine executing the program. Both approaches have pros and cons that we'll cover in this tutorial. If interested Wikibooks also has material on this subject.

Why should you learn C++?

The C++ language originally derives from the imperative language C. The defining feature which distinguishes C++ from C is support for Object-Oriented Programming (OOP). This makes C++ a multi-paradigm programming language. An example that can help to demonstrate what OOP means:

If you were writing a program to track the statistics of a racing cyclist, you might make different parts of the program for their age, years of racing, wins, falls, what teams they've raced with and so on. In real life, though, that's not how we think. Instead, we would think of the cyclist as a whole, and the different statistics as being part of him. We could also apply that general "model" of a cyclist, maybe with a few modifications, to any cyclist, and have a complete representation of them. This is the essence of object-oriented programming, and as you understand it more fully, it will allow you to create powerful, but yet easily-understood programs. Instead of relying on data that is scattered throughout a program, you can create a block of code that defines everything you need, and then you reuse that throughout the code.

As a further example, think of a motor car. You unlock it with the key, and get in. Then, you turn the ignition, put the car in reverse, release the brake, and press the accelerator. As you drive, you use the steering wheel, the brake, and the accelerator (and maybe the clutch). You don't know or need to know all the specifics of the car to make it work. You just use what you need, and it's simple, too. Object-oriented programming is like that. You can make powerful code, but it's all hidden, and you can interact and reuse that code using the simple controls.

Other languages, such as Java, Python, Smalltalk and C#, allow the programmer to write code in this object-orientated way. The key difference between C++ and these languages is that C++ is designed to be compiled into efficient low-level code which can run directly on the processor of a computer. This ability means that C++ differs in many ways from these other languages, and lacks many of the advanced facilities you might be familiar with if you already know one of them.

Prerequisites

Your enthusiasm. This is meant for a first time user. Every lesson will only depend on what has already been taught in previous lessons. All you need here is your willingness to learn, experiment, and have fun with computers.

Get an IDE (Integrated Development Environment), generally consisting of a GUI (graphic user interface), a compiler (transforms C/C++ code into a machine readable program) and a text editor. Most C++ IDEs use the GNU C++ compiler which is part of the GNU Compiler Collection (GCC). This is a program from the Free Software Foundation. It is distributed under the GNU General Public License (GPL). For detailed information check http://gcc.gnu.org.

Some might say that it is important to learn to edit code using an editor, and compile it manually. There is time for that later; the manual editing process changes depending on system and compiler, so put it off until you can write significant programs.

Recommendations for an IDE are Microsoft Visual Studio Express C++ (freeware, Windows; step-into debugging,) Xcode (closed-source, Macintosh OS X, step-into debugging,) Eclipse, or Code::Blocks IDE with Mingw (open source, cross-platform; no step-into debugging.) Dev-C++ is often mentioned, but it doesn't seem to have seen active development in years, and can be very inconvenient to use. You can download a fully functional version of Dev-C++ free of charge from the developers website http://www.bloodshed.net/download.html. Another good IDE in Code::Blocks http://www.codeblocks.org, Dev-C++ is old and has been discontinued by its creator.

A fairly recent addition to this list is the Open Watcom C++ compiler and environment, which is available for several operating systems. Most of the compilers/IDEs listed here are native to the Microsoft Windows Operating System. C/C++ was born on UNIX, and there are several free UNIX operating systems such as FreeBSD. C/C++ comes with most GNU/Linux variants. Any of the above listed operating systems, and compilers/IDEs are sufficient to learn to program C/C++.

Course Description

This course covers everything, from the most basic principles of C++ up to advanced concepts such as polymorphism and inheritance.

Pros and Cons of C++

Pros

Cons

Lessons

Beginners

Data Structures

Advanced

To be merged

Enrolled

Tavoricko 16:58, 1 July 2010 (UTC)

Snitch (discuss • contribs) 09:26, 28 June 2013 (UTC)Moving from VBA to c++ (beginner). WikyU looks great!

Resources

Books

Websites

Subject classification: this is an information technology resource .
This article is issued from Wikiversity - version of the Sunday, February 28, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.