Home

Submit

Source

Feeds
Tutorials » C and C++ » Functions and Classes

C and C++ Functions and Classes Tutorials

C and C++ Functions Tutorials

C and C++ Functions and Classes
Polymorphism
C and C++ / Functions and Classes
Before getting into this section, it is recommended that you have a proper understanding of pointers and class inheritance.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Friendship and inheritance
C and C++ / Functions and Classes
In principle, private and protected members of a class cannot be accessed from outside the same class in which they are declared.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Classes (II):Overloading operators
C and C++ / Functions and Classes
C++ incorporates the option to use standard operators to perform operations with classes in addition to with fundamental types.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Classes (I)
C and C++ / Functions and Classes
A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions. An object is an instantiation of a class. In terms of variables, a class would be the type, and an object would be the variable.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Functions (II)
C and C++ / Functions and Classes
Until now, in all the functions we have seen, the arguments passed to the functions have been passed by value. This means that when calling a function with parameters, what we have passed to the function were copies of their values but never the variables themselves.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Functions (I)
C and C++ / Functions and Classes
Using functions we can structure our programs in a more modular way, accessing all the potential that structured programming can offer to us in C++.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Control Structures
C and C++ / Functions and Classes
A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose, C++ provides control structures that serve to specify what has to be done by our program, when and under which circumstances.

Site: www.cplusplus.com Report - View Tutorial

C and C++ Functions and Classes
Polymorphism and Abstraction
C and C++ / Functions and Classes
In an inheritance scenario, a parent class is configured to provide its child with the basic foundation the child needs. Although a child can implement a new behavior not available on the parent object, sometimes a child object will need a customized implementation of a behavior that has already been configured with its parent. That is what happens for example when inheriting a sphere from a circle class. Both have a characteristic called Area but the area is calculated differently on each shape.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
Exceptions and Classes
C and C++ / Functions and Classes
Exceptions are an integral and unavoidable part of the operating system and programming. One way you can handle them is to create classes whose behaviors are prepared to deal with abnormal behavior. There are two main ways you can involve classes with exception handling routines: classes that are involved in exceptions of their own operations and classes that are specially written to handle exceptions for other classes.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
Operator Overloading
C and C++ / Functions and Classes
Operator overloading is the ability to tell the compiler how to perform a certain operation when its corresponding operator is used on one or more variables.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
Object Construction and Destruction
C and C++ / Functions and Classes
In order to further customize the behavior of an object, you should make sure that it completely controls its member variables. An object should "know" what kind of values its variables hold and what values are not acceptable. As a starting point, when calling an object from another function, you should know what value a particular member is holding, before performing any operation. To solve this problem, one solution is to provide a special function that would initialize the member variables.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
The Methods of a Class
C and C++ / Functions and Classes
The primary motivation of using classes in a program is to create objects as complete as possible. An object must be able to handle its own business so that the other objects of the program or of another program would only need to know which object can take care of a particular need they have. A regular variable, as a member of an object, cannot handle assignments. This job is handled by particular functions declared as members of a class. A function as a member of a class is also called a Method. On this site, the words "method" and "function", when associated with a class, will refer to the same thing: a member function of the class.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
Introduction to Classes
C and C++ / Functions and Classes
C++ offers three techniques of defining a new data type: a structure, a class, and a union. These are also referred to as composite data types. Learn: Object Creation and Access, Global Objects, Access to a Member of a Class, Type-Defining a Class, Class Forward Definition, The Access Levels of a Class, Initializing Each Member of a Class, Initializing an Object as a Whole, Static Member Variables, Techniques of Creating a Classic C Styles Object, References, Constant Objects and more.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
Strings
C and C++ / Functions and Classes
Learn the following: Declaring and Initializing an Array of Characters, Streaming an Array of Characters, Multidimensional Arrays of Characters, Declaring a Pointer to Characters, Declaring and Initializing an Array of Characters, Requesting an Array of Characters, Arrays of Characters and Pointers, Dynamic Arrays of Characters, Passing an Array of Characters, Returning an array of Characters, Multidimensional Arrays of Characters, Double-Dimensional Arrays Declaration, Two-Dimensional Arrays of Characters and Functions, Introduction to Strings, Defining a String, String Manipulation Functions, Copying One String Into Another, Comparing Strings Functions, Working With Individual Characters, Working With Sub-Strings, Working With Character Cases, Formatting Strings.

Site: www.functionx.com Report - View Tutorial

C and C++ Functions and Classes
Pointers and Functions
C and C++ / Functions and Classes
Learn: Reviewing Functions, Declaring a Pointer to Function, Using a Pointer to Function, A Pointer to a Function as Argument, Passing a Function as Argument, An Array of (Pointers to) Functions, Using an Array of Functions and more.

Site: www.functionx.com Report - View Tutorial

Random Tutorials
C and C++ General Development
Concepts Extending C++ Templates For Generic Programming
C and C++ / General Development
This video tutorial will provide an overview of the new features introduced by concepts and how they will benefit C++ programmers. We will see how concepts can be used to express the core components of the C++ Standard (Template) Library, and explore some of the new capabilities that concepts bring to the C++ language.

Site: www.codebeach.com Report - View Tutorial

C and C++ General Development
Data Input/Output
C and C++ / General Development
The values and expressions used in C++ are displayed using the cout extractor. To make the displaying of data more realistic, the cout is configured to handle or format data to any desired result. While the cout (as a class) is defined in the iostream file, some other files provide other extensive techniques for displaying data to the console. The C language also is equipped with other formatting functions used for the same purpose. The ability to create a program made of mixed C and C++ language enhances these formatting possibilities.

Site: www.functionx.com Report - View Tutorial

C and C++ Getting Started
Operators
C and C++ / Getting Started
This tutorial introduce operators.

Site: www.cplusplus.com Report - View Tutorial

C and C++ General Development
Switch Case
C and C++ / General Development
Switch case statements are a substitute for long if statements that compare a variable to several "integral" values.

Site: www.cprogramming.com Report - View Tutorial

C and C++ General Development
CD Drive Control
C and C++ / General Development
Enumerates all CD-ROM drives and allows them to be opened and closed at the touch of a button.

Site: www.geekpedia.com Report - View Tutorial

 
Site Search

 
C and C++ »
 
Categories
2D Graphics 3D Graphics Office Applications Databases Desktop Programming Web Development
 
Advertisement