Inheritance C and C++ / General Development
This tutorial is n Inheritance is an important feature of classes; in fact, it is integral to the idea of object oriented programming. Inheritance allows you to create a hierarchy of classes, with various classes of more specific natures inheriting the general aspects of more generalized classes.
Binary Trees: Part 1 C and C++ / General Development
The binary tree is a fundamental data structure used in computer science. It is a useful data structure for rapidly storing sorted data and rapidly retrieving stored data.
Recursion C and C++ / General Development
Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In C++, this takes the form of a function that calls itself. A useful way to think of recursive functions is to imagine them as a process being performed where one of the instructions is to "repeat the process".
Linked Lists C and C++ / General Development
Linked lists are a way to store data with structures so that the programmer can automatically create a new place to store data whenever necessary. Specifically, the programmer writes a struct or class definition that contains variables holding information about something, and then has a pointer to a struct of its type. Each of these individual struct or classes in the list is commonly known as a node.
Command Line Arguments C and C++ / General Development
In C++ it is possible to accept command line arguments. Command-line arguments are given after the name of a program in command-line operating systems like DOS or Linux, and are passed in to the program from the operating system.
Typecasting C and C++ / General Development
Typecasting is making a variable of one type, such as an int, act like another type, a char, for one single operation. To typecast something, simply put the type of variable you want the actual variable to act as inside parentheses in front of the actual variable. (char)a will make 'a' function as a char.
Strings C and C++ / General Development
In C++ there are two types of strings, C-style strings, and C++-style strings. This tutorial will discuss C-style strings.
Arrays C and C++ / General Development
Arrays are useful critters because they can be used in many ways. For example, a tic-tac-toe board can be held in an array. Arrays are essentially a way to store many values under the same name. You can make an array out of any data-type including structures and classes.
Structures C and C++ / General Development
Structures are a way of storing many different values in variables of potentially different types under the same name. This makes it a more modular program, which is easier to modify because its design makes things more compact.
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.
Loops C and C++ / General Development
Loops are used to repeat a block of code. Being able to have your program repeatedly execute a block of code is one of the most basic but useful tasks in programming -- many programs or websites that produce extremely complex output (such as a message board) are really only executing a single task many times.
If Statements C and C++ / General Development
The ability to control the flow of your program, letting it make decisions on what code to execute, is valuable to the programmer. The if statement allows you to control if a program enters a section of code or not based on whether a given condition is true or false. One of the important functions of the if statement is that it allows the program to select an action based upon the user's input.