THE PROGRAMMER'S GUIDE TO C/C++

 

C/C++: A Historical Perspective

We begin our journey of C/C++ with a little history. C, the predecessor to C++, has become one of the most popular programming languages. Originally designed for systems programming, C enables programmers to write efficient code and provided close access to the machine. C compilers, found on practically every Unix system, are now available with most operating systems.

During the 1980s and into the 1990s, an explosive growth in object-oriented technology began with the introduction of the Smalltalk language. Object-Oriented Programming (OOP) began to replace the more traditional structured programming techniques. This explosion led to the development of languages which support programming with objects. Many new object-oriented programming languages appeared: Object-Pascal, Modula-2, Mesa, Cedar, Neon, Objective-C, LISP with the Common List Object System (CLOS), and, of course, C++. Although many of these languages appeared in the 1980s, many ideas of OOP were taken from Simula-67. Yes! OOP has been around since 1967.

C++ originated with Bjarne Stroustrop. In the simplest sense, if not the most accurate, we can consider it to be a better C. Although it is not an entirely new language, C++ represents a significant extension of C abilities. We might then consider C to be a subset of C++. C++ supports essentially every desirable behavior and most of the undesirable ones of its predecessor, but provides general language improvements as well as adding OOP capability. Note that using C++ does not imply that your are doing OOP. C++ does not force you to use its OOP features. You can simply create structured code that uses only C++'s non-OOP features.

C++: A Better C

The designers of C++ wanted to add object-oriented mechanisms without compromising the efficiency and simplicity that made C so popular. One of the driving principles for the language designers was to hide complexity from the programmer, allowing them to concentrate on the problem at hand.

Because C++ retains C as a subset, it gains many of the attractive features of the C language, such as efficiency, closeness to the machine, and a variety of built-in types. A number of new features were added to C++ to make the language even more robust, many of which are not used by novice programmers. By introducing these new features here, we hope that you will begin to use them in your own programs early on and gain their benefits. Some of the features we will look at are the role of constants, inline expansion, references, declaration statements, user defined types, overloading, and the free store.

Most of these features can be summarized by two important design goals: strong compiler type checking and a user-extensible language.

By enforcing stricter type-checking, the C++ compiler makes us acutely aware of data types in our expressions. Stronger type checking is provided through several mechanisms, including: function argument type checking, conversions, and a few other features we will examine below.

C++ also enables programmers to incorporate new types into the language, through the use of classes. A class is a user-defined type. The compiler can treat new types as if they are one of the built-in types. This is a very powerful feature. In addition, the class provides the mechanism for data abstraction and encapsulation, which are key to object-oriented programming. As we examine some of the new features of C++ we will see these two goals resurface again and again.

 

C Programming Language Guide                       

Keywords used in C programming.                                                     

Structure of C language.

 Data Types.

Variable declaration, formal parameters, and modifiers.

 Operators and Functions.

 Control Statements.

 Input/Output and Pointers.

 Accessing different structures, bit fields, unions, and enumerations.

 File Input/Output through streaming.

 Strings and Text Handling.

 Handling Time.

  Header Files, Debugging, and Errors.

 Casting, Interrupts, Pointers to Functions, and Prototyping.

  Sorting and Searching.

  Dynamic Memory Allocation, and Variable Arguments.

 

C++ Programming Language Guide

Improved Comments, and the Scope operator.

 I/O Stream Library.

 Definitions and Declarations.

Dynamic Allocation, and Pointers.

Prototypes and Compatible Types.

 Default Parameters.

 Encapsulation.

 Objects.

Variable Decleration and Definition, Dynamically allocate object, and Pointer to object.

 Keyword THIS, and Link list to objects.

 Parameterised Types,  Class Template, and Exception Handling.

 

Links:  Home C Programming Guide  C++ programming Guide

Contact Me