due in 4 hours Paraphrase my paper its 15 pgs and make sure its free from plagiarism edit the paper and if needed add more info

Comparing and Contrasting C & C++ Languages

due in 4 hours Paraphrase my paper its 15 pgs and make sure its free from plagiarism  edit the paper and if needed add more info 1

Sharouk Baker

Marymount University

IT- 500

Hossein Beyzavi

08-03-2017

Table of Content

Abstract 2

Introduction 3

A brief History of C 4

A brief History of C++ 5

Features of C++ 6

Features of C 10

10

Differences between C and C++ 11

C Compiler Theory 12

C++ Compiler Theory 13

Conclusion 14

References 15




Abstract

C is a powerful programming language. It is fast, manageable and available in all platforms, and C++ is an excellent programming language with modern features that can be used in various kinds of outputs. In this research paper I intend to explain the history of C& C++. Secondly, I will discuss the differences between the C++ & C language. I intend to list out the features of both languages. Lastly, I intend to explain the compiler theory for both C and C++ languages.






Introduction

Naturally, Human brains are able to develop a highly complex linguistic system. The brain has the ability to learn and understand many languages. Natural languages such as Arabic, English and French are used for communication between people and have grown naturally in humans through use, share of feeling, share of thoughts and desires; languages are the foundation of civilization, and science.

On the other hand, programming languages (machine languages) are just for machines. They are intended to communicate instructions and commands which inform the machine to do “something”. These commands are called C++ source code, or just source code. Moreover, there are many different programming languages, such as C, C++, Java, Python and many others. “In 1957, the first major programming language appeared in the form of FORTRAN which stands for FORmula TRANslating system. The language was designed at IBM for scientific computing. The components were very simple, and provided the programmer with low-level access to the computer's innards.”(Ferguson, Andrew) 1

The purpose of this paper is to compare and contrast the C and C++ programming languages. Both languages have interesting history background and the significant features. Also, to learn about the compliers of both languages.

A brief History of C

Throughout the 1960s, and into the early 1970s, numerous programs have been written in assembler language. Originally, the C programming language was developed as a language to replace assembler in systems programming. It was very successful, making system code portable and human-readable.

C started to grow in popularity not just for systems programming, but as a general purpose programming language. Today, C is one of the most used programming languages even though it’s an old programming language, but it’s still very strong. The C programmer must understand that C was designed to replace an assembler language and that in several important ways; it retains a very low level view of the machine.

The C programming language was developed at Bell Labs during the early 1970's. Quite suddenly it derived from a computer language named B and from an earlier language BCPL. Originally it was designed as a system programming language under UNIX. UNIX is known as a high performance operating system that expanded to have usage on a wide range of different computers and other products.

The earlier versions of "The C Programming Language" book was named after the authors of the book K&R C. As the language developed and standardized, a version known as ANSI (American National Standards Institute) C became dominant. As you study this language expect to see references to both K&R and ANSI C. Although it is no longer the language of choice for most new development, it still is used for some system and network programming as well as for embedded systems. More importantly, there is a tremendous amount of codes written in the C language and many people are familiar with it and still actively maintained.

A brief History of C++

In 1979, Bajrne Stroustrup, a Danish computer scientist, created and developed the C++ programming language at Bell Labs located in NJ, as an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983. Stroustrup had been hacking away at his replacement for the C programming language at AT&T Bell labs since 1979, where he and his colleagues in the research department were given free reign to experiment with new ways of building software.” (Calore, Michael).

C++ is one of the most popular modern programming languages ever created. It was designed to be a “general use” language: It can be run on just about any platform, and it shows up almost everywhere, especially in videogames and embedded systems. C++ is known as the middle level programming language. Also, known as C++ is a superset of C and it can run on variety of platforms, such as, many versions of UNIX, Mac OS and Windows

“If I had thought of it and had some marketing sense,” Stroustrup says, “every computer and just about any gadget would have had a little ‘C++ Inside’ sticker on it.” After publishing The C++ Programming Language, Stroustrup continued to stay active in the C++ community, working on the language’s design, writing compilers and helping to make the language an ISO standard in 1998. (Calore, Michael) 2

Features of C++

The C++ is object oriented programming language and it is a very simple and easy language, this language has following features:

Simple

C++ program languages are usually written in the English languages so it’s easier for programmers to understand.

Platform dependent

The C++ is a platform dependent whenever the program is execute in the same operating system where that was developed and compiled but not run and execute on other operating system. C++ is platform dependent language.

Portability

In C++ Language .cpp file contain source code, we can edit also this code. .exe file contain application, only we can execute this file. When we write and compile any C++ program on window operating system that program easily run on other window based system.

Powerful

C++ is a very powerful programming language, it have a wide verity of data types, functions, control statements, decision making statements, etc.

Object oriented Programming language

The C++ is an object-oriented program, it was created to writing program for different purposes and it fully supports the four pillars of object-oriented development: data-hiding, inheritance, encapsulation and polymorphism.

Middle level language

C programming language can supports two level programming instructions with the combination of low level and high level language that's why it is called middle level programming language.

Structure oriented

C is a Structure oriented programming language. Structure oriented programming language aimed on clarity of program, reduce the complexity of code, using this approach code is divided into sub-program/subroutines. These programming have rich control structure.

Modularity

It is concept of designing an application in subprogram that is procedure oriented approach. In c programming we can break our code in subprogram.

Case sensitive

C++ is a case sensitive programming language. In C++ programming the lower case letter it's treated separately and the upper case letter separately too. For example, 'break and BREAK' both are different.

Compiler based

C++ is a compiler based programming language that means without compilation no C++ program can be executed. First we need compiler to compile our program and then execute.

Syntax based language


C++ is a strongly tight syntax based programming language. If any language follows rules and regulation very strictly is known as strongly tight syntax based language.

Efficient use of pointers

In C++ language pointer concept is available. It is the concept of carrying the instruction from one system to another system.

Features of C due in 4 hours Paraphrase my paper its 15 pgs and make sure its free from plagiarism  edit the paper and if needed add more info 3

This diagram demonstrates most of the important features of the C language. First of all, the C language is known as a robust language because of its rich set of built-in functions and operators that can be used to write any type complex program. Second of all, Programs written in C are efficient and fast because of the variety of data type and powerful operators. Third of all, C is highly portable this means that programs once written can be run on another machines with little or no modification. Another important feature of C program is its ability to extend itself. Last but not least, A C program is basically a collection of functions that are supported by C library. We can also create our own function and add it to C library. Lastly, the C language is the most widely used language in operating systems and embedded system development today.3

Differences between C and C++

Both languages share some common syntax; however they are very different in nature. The C is language is a procedural language which means it's a programming language that specifies a series of well-structured steps and procedures within its programming context to compose a program. It also does not support classes and objects. On the other hand, C++ is a combination of both procedural and object oriented programming language; therefore C++ can be called a hybrid language.

There are many differences between both languages. First of all, Comparing C to C++, C is a subset of C++. C++ can run most of C code while C cannot run C++ code. Secondly, C supports procedural programming paradigm for code development. On the other hand, C++ supports both procedural and object oriented programming paradigms; therefore C++ is also called a hybrid language. Also, the C language does not support function and operator overloading. However, C++ supports both function and operator overloading. Last but not least, the C language does not support reference variables and it also has no support for virtual and friend functions. On the other hand, C++ supports reference variables and also supports virtual and friend function



C Compiler Theory

The first C with Classes compiler was called Cfront, which was resulting from a C compiler called CPre and was mainly designed to translate C with Classes code to ordinary C. Also, it's interesting that Cfront was written in C with Classes, making it a self- hosting compiler. Cfront would later be abandoned in 1993 after it became difficult to integrate new features into it, namely C++ exceptions. However, Cfront made an enormous impact on the implementations of future compilers and on the UNIX operating system.

Furthermore, there are three things that are necessary for creating C programs: a text editor, a compiler and a C standard library. In order to create text editor all it requires is a source code for a program in C or in any other language. Source code is the version of software as it is originally written by a human in plain text. A text editor is a program for writing and editing plain text. It’s very different from a word processor because it does not manage document formatting or other features commonly used in desktop publishing. C programs can be written using any text editors that are available for Linux, such as vi, gedit, kedit or emacs. For example:

  • To run or start a file use type the following command before the filename and press ENTER:

Vi myfilename

  • To compile the program type the following command and press the ENTER key:

gcc myfilename.c

  • To execute the program type the following command and press the ENTER key:

./a.out

C++ Compiler Theory

The Cfront was the original compiler for C++. However, nowadays there many other compilers for C++.The two most widely used compilers are probably MSVC) Microsoft Visual C++ compiler and its offered by Microsoft for windows platforms, and GNU Compiler Collection GCC / G++ which contains high quality C and C++ compilers and they are ready to installed in most of UNIXs systems, and on windows.

The process for compiling a C++ program is similar to the C program, but uses the command g++ instead of gcc. Both languages compilers are part of the GNU Compiler Collection.

➢ In order to demonstrate the use of g++, this is a popular example “Hello World” program written in C++ programming language:

due in 4 hours Paraphrase my paper its 15 pgs and make sure its free from plagiarism  edit the paper and if needed add more info 4

➢ In order to compile the program type the following command and press the ENTER key:

$ g++ -Wall hello.cc -o hello

➢ the resulting executable can be run in exactly same way as the C version, just by typing its filename:

$ ./hello Hello, world!

Conclusion

Programmers are usually seeking for languages that have significant features and high quality compilers. Therefore, both C and C++ languages have many significant features and each language can have advantages and disadvantage or strengths, depending on the programmer’s perspective. The main difference between the two languages is the static nature of C++ versus the dynamic nature of Objective C. For the programmers who are new to using object-oriented (OO) programming languages, the choice is primarily between the C++ and the C language. C++ is a feature-rich, human readable and more complex and C has its wide industry acceptance, easier-to-learn, flexible, but less widely used.



References
  • "Homepage - Max Planck Society." Startseite - Max-Planck-Gesellschaft. N.p., n.d. Web. 02 Aug. 2017.

  • Ferguson, Andrew. A History of Computer Programming Languages. N.p., n.d. Web. 02 Aug. 2017.

  • "C vs C - Which Programming language is better?" Technotification. N.p., 07 June 2017. Web. 02 Aug. 2017.

  • Features of C Language | C Language Tutorial | Studytonight. N.p., n.d. Web. 02 Aug. 2017.

  • Point, Tutorials. "C Overview." Www.tutorialspoint.com. Tutorials Point, 23 July 2017. Web. 29 July 2017.

  • Calore, Michael. "Inventor of C reflects on 25 years of the programming language." WIRED UK. WIRED UK, 22 May 2016. Web. 01 Aug. 2017.

  • Sitesbay.com. "Sitesbay - Easy to Learn." Features of C - Sitesbay. N.p., n.d. Web. 02 Aug. 2017.

  • An Introduction to GCC - Compiling a simple C program. N.p., n.d. Web. 02 Aug. 2017.

  • Kumar, Krishan. "Difference Between C and C With Example. C vs C." Cs-fundamentals.com. Cs-fundamentals.com, n.d. Web. 02 Aug. 2017.

1 Ferguson, Andrew. A History of Computer Programming Languages. N.p., n.d. Web. 02 Aug. 2017.

2Calore, Michael. "Inventor of C reflects on 25 years of the programming language."

3 Features of C Language | C Language Tutorial | Studytonight. N.p., n.d. Web. 02 Aug. 2017.