- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Introduction

Posted by Tayyab


What is C++?

C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.
C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features.
C++ was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill, New Jersey, as an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983.
C++ is a superset of C, and that virtually any legal C program is a legal C++ program.
Note: A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time.
Well, that sure is a question, and many people will give you many answers, but the simplest one is this; It is an object-orientated, compiled programming language. If you’ve never programmed before, even that answer may be confusing, so let me explain.
First, the “compiled” part. There are two different types of programming languages; interpreted languages and compiled languages. Interpreted languages are run by an aptly-named “Interpreter” program, which reads your program’s code and then executes each command one by one. Compiled languages, on the other hand, are not read by programs at all, but are read by your computer’s CPU. However, as some of you may already know, computers can’t read letters. They only understand binary numbers, so first your code must be translated into computer readable machine code. This process is named compiling. In a nutshell, an interpreted language is read straight away by a normal program, but a compiled language is first translated and then read by the CPU. C++, as previously mentioned, is a compiled language.
Now for the “object-orientated” bit. Basically, this is just the way the code is structured. This won’t matter to begin with, so I won’t explain it now. We’ll be covering it later, don’t worry.

What does this all mean to me?

As a C++ programmer you will need more than just a text editor. There are very few programming languages where that is all you need, and they aren’t really true programming languages at all. Anyway, one of these things you will need is, obviously, a compiler. 
Another thing you will probably want to use is an IDE, which stands for Integrated Development Environment. This is basically a programmer-orientated text editor, which has syntax highlighting and normally compiler integration. For both Linux and Windows I recommend Code::Blocks, but there are many other great options such as Dev-C++, TurboC++ 3.0 and GNU Emacs. You don’t need a dedicated IDE however, a basic text editor will suffice, although something like Notepad can certainly make things difficult. Word processors are definitely not the best choice, since they usually have annoying spell correction and automatic formatting to suit writing, and not coding, styles.

Is there anything else I should know?

Yes, as a matter of fact there is. For a start, C++ has very rigid syntax. While it doesn’t really care about white-space, like Python does, it is case-sensitive, so beware of what you type. “Hello” is different to “hello” in C++’s view.
Well then, that’s about it as regards to what is it, and I’m guessing you probably want to get into some actual programming, don’t you? All right then, here we go.
OVER VIEW

Object-Oriented Programming

C++ fully supports object-oriented programming, including the four pillars of object-oriented development:
  • Encapsulation
  • Data hiding
  • Inheritance
  • Polymorphism

Standard Libraries

Standard C++ consists of three important parts:
  • The core language giving all the building blocks including variables, data types and literals, etc.
  • The C++ Standard Library giving a rich set of functions manipulating files, strings, etc.
  • The Standard Template Library (STL) giving a rich set of methods manipulating data structures, etc.

The ANSI Standard

The ANSI standard is an attempt to ensure that C++ is portable -- that code you write for Microsoft's compiler will compile without errors, using a compiler on a Mac, UNIX, a Windows box, or an Alpha.
The ANSI standard has been stable for a while, and all the major C++ compiler manufacturers support the ANSI standard.

Learning C++

The most important thing to do when learning C++ is to focus on concepts and not get lost in language technical details.
The purpose of learning a programming language is to become a better programmer; that is, to become more effective at designing and implementing new systems and at maintaining old ones.
C++ supports a variety of programming styles. You can write in the style of Fortran, C, Smalltalk, etc., in any language. Each style can achieve its aims effectively while maintaining runtime and space efficiency.

Use of C++

C++ is used by hundreds of thousands of programmers in essentially every application domain.
C++ is being highly used to write device drivers and other softwares that rely on direct manipulation of hardware under realtime constraints.
C++ is widely used for teaching and research because it is clean enough for successful teaching of basic concepts.
Anyone who has used either an Apple Macintosh or a PC running Windows has indirectly used C++ because the primary user interfaces of these systems are written in C++.



<< Previous                                                                                                                 Next >>    

0 comments:

Post a Comment