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.
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.
Data Structures C and C++ / Miscellaneous
We have already learned how groups of sequential data can be used in C++. But this is somewhat restrictive, since in many occasions what we want to store are not mere sequences of elements all of the same data type, but sets of different elements with different data types.
Dynamic Memory C and C++ / Getting Started
Until now, in all our programs, we have only had as much memory available as we declared for our variables, having the size of all of them to be determined in the source code, before the execution of the program. But, what if we need a variable amount of memory that can only be determined during runtime? For example, in the case that we need some user input to determine the necessary amount of memory space.
Character Sequences C and C++ / Getting Started
As you may already know, the C++ Standard Library implements a powerful string class, which is very useful to handle and manipulate strings of characters. However, because strings are in fact sequences of characters, we can represent them also as plain arrays of char elements.
Arrays C and C++ / Getting Started
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.
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.
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++.
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.
Basic Input/Output C and C++ / Getting Started
Using the standard input and output library, we will be able to interact with the user by printing messages on the screen and getting the user's input from the keyboard.
Basic C++ Functions C and C++ / Functions and Classes
Functions are bits of code that the program jumps to in order to do certain tasks. The main function holds the main code (the code that is executed first) and where the other functions are called from. Variables can be passed into and returned from a function.
The Binary Adding Machine C and C++ / Getting Started
Ever wondered how computers work? In this tutorial, I attempt to explain this from the ground up. First, we'll look at how a machine can add numbers.
Introduction to Functions C and C++ / Functions and Classes
A function is an assignment or a task that must be performed to complement the other part of a program. There are two kinds of functions: those supplied to you and those you will be writing. The functions that are supplied to you are usually in three categories: those built-in the operating system, those written in C++ and those supplied with your programming environment. The use of these functions is the same regardless of the means you get them; you should know what a function looks like, how to create one, what functions are already available, where they are located, and what a particular function does, how and when to use it.