Results 1 to 3 of 3

Thread: +++ C++ Introduction +++

  1. #1
    Join Date
    May 2006
    Posts
    102

    Default +++ C++ Introduction +++

    C++ was written by Bjarne Sroustrup at Bell Labs during1983 -1985. C++ is an extension of C. Prior to1983 , Bjarne Stroustrup added features to C and formed what he called "C with Classes". He had combined the Simula's use of classes and object-oriented features with the power and efficiency of C. The term C++ was first used in1983 .

    C++ was developed significantly after its first release. 1In particular, "ARM C++" added exceptions and templates, and ISO C++ added RTTI, namespaces, and a standard library.1

    C++ was designed for the UNIX system environment. With C++ programmers could improve the quality of code they produced and reusable code was easier to write.

    Bjarne Stroustrup had studied in the doctoral program at the Computing Laboratory at Cambridge University prior to joining Bell Labs. Now, Bell Labs no longer has that name since part of Bell Labs became AT&T Labs. The other half became Lucent Bell labs.

    Prior to C++, C was a programming language developed at Bell Labs circa 1969-1973. The UNIX operating system was also being developed at Bell Labs at the same time. C was originally developed for and implemented on the UNIX operating system, on a PDP- 11computer by Dennis Ritchie. He extended the B language by adding types in1971 . He called this NB for New B. Ritchie credited some of his inspiration from theAlgol 68language. Ritchie restructured the language and rewrote the compiler and gave his new language the name "C" in1972 .90 % of UNIX was then written in C. The committee that wrote the 1989 ANSI Standard for C had started work on the C Standard project in 1983after having been established by ANSI in that year. There were quite a number of versions of C at that time and a new Standard was necessary.

    C is portable, not tied to any particular hardware or operating system. C combines the elements of high-level languages with the functionality of assembly language and has occasionally been referred to as a middle-level computer language. C makes it easy to adapt software for one type of computer to another.

    C was a direct descendant of the language B. The language B was developed by Ken Thompson in 1970 for the new UNIX OS. B was a descendant of the language BCPL designed by Martin Richards, a Cambridge University student visiting MIT.

  2. #2
    Join Date
    May 2006
    Posts
    102

    Default What a C++ Program is

    [l]What's a C++ Program?!

    Simply a C++ program is a set of instructions that's given to the computer to follow it, and obtain the result we're expecting.

    Exactly like when you give your little brother, and tell him the following in order to clean the house.

    1- Go to the kitchen
    2- Look for a swipper
    3- Hold it
    4- Go out of the kitchen
    5- Start swipping the floor
    6- Leave the swipper
    7- Well done, the house is cleaned.

    A very pricise set of instructions for the kid to follow, if he followed it properly, you'll get your house cleaned, otherwise, many things else would happen.

    The C++ program is exactly the same. You give the computer set of instructions to follow it, if you gave him wrong set, you won't get what's expected.

    We often use 'Borland C++' to write our programs, but unfortunately it's not free.

  3. #3
    Join Date
    May 2006
    Posts
    102

    Default +++ Introduction Cont +++

    The computer is not smart as humans, so every line of instructions we give to it, should be written very precisely, i.e., in details.

    Moreover, the language that the computer do understand, is really complicated for humans to do. Thus, a C++ code has to be "compiled" (converted) to the language that the computer understands which is sometimes called: Machine Language, or High-level language.

    That's what the compiler does. It takes our set of instructions, and convert it to the machine language which the computer understands and give us the output we expect.

    The compiled file is in .exe, and is openned by MS-DOS Prompt. While the file of the code itself (The language we do understand, i.e., C++) is in .cpp file extension (Stands for C Plus Plus).

    C++ code consists of several functions. Where "function" is a block of code that do certain calculations or processes.

    The function main must be in every program we write, and it looks like that:

    void main(){

    //set of instructions

    }

    The first line of the function is somewhat called the "title" of the function. You can call the ending braces '}' the "full stop" of the function.

    The line after the two slashes '//' is called "comment" and all the line after it is ignored by the compiler

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •