I/O Streams (cin, cout, cerr, stream operators) [C++]
I/O Streams in C++ is an standard included library, the library consists of (basic class templates, class template instantiations, standard objects, types, and manipulators).
cin - is an object of the class of istream that notates the standard input stream, corresponding to cstdio stream. cin like most systems defaults its standard input from the keyboard.
cout - is an object of the class of ostream that notates the standard output stream, corresponding to cstdio stream.
cerr - is the standard output stream for errors.
Namespaces [C++]
Namespaces give groups like classes and functions a more global scope, for instance if you had two int's in your program but you wanted each to have its own global scope you could name one namespace first and the other namespace second like in the example shown below.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
// using #include <iostream> using namespace std; namespace first { int x = 5; int y = 10; } namespace second { double x = 3.1416; double y = 2.7183; } int main () { using first::x; using second::y; cout << x << endl; cout << y << endl; cout << first::y << endl; cout << second::x << endl; return 0; }
Type Casting Operators, Const-Volatility Specifiers (const, volatile) [C++]
casting operators remove c syntax inherent for the purpose of making the types more compatible with c++, there are several casting operators.
dynamic_cast - conversion of polymorphic types.
static_cast - conversion of non polymorphic types.
const_cast - removes the const, volatile, and _unaligned attributes
reinterpret_cast - simple reinterpretation of bits.
safe_cast - produce verifiable MSIL.
Classes (Objects, Constructor, Destructor, Access Control, Public, Protected, Private, Friend, “this” pointer) [C++]
A class allows you to put functions inside of a data structure for the purpose of organization and ease of use.
A constructor is a function that can be included within a class that can be automatically called whenever a new object is created within that class for the reason of avoiding returning unexpected values.
Destructors are called automatically when an object is destroyed with the purpose of releasing previously allocated memory.
Access Control breaks down into the Public, Protected, and Private data type sub class definitions.
Public variables and data types are accessible to the program outside of the class
Protected are accessible but may not be changed
Private variables and data types are only available inside that specific class they are defined in and may not be acted upon by the outside program.
this pointer can only be used as a nonstatic member function of a class, struct, or union.
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
class example{ public: int a; int b; int c; int d; private: int e; int f; protected: int g; };
Inheritance (single, multiple Inheritance), Polymorphism/Virtual Functions, Abstract Base Class [C++]
Inheritance in object oriented programming is used to create a relationship between two or more classes.
when using single class inheritance it means pretty much what it sounds like a sub class can only inherit from one super class or parent class.
and obviously multiple inheritance means that you can inherit information in your subclasses from more than one parent class.
Polymorphism with pointers using the ability that a pointer to a derived class is then compatible with a pointer to it's base class also.
Virtual members or functions are members of a class that can be changed in a derived class.
An abstract class is designed to be a base class that contains a pure virtual function.
class A { public: void DoSomethingALike() const {} }; class B : public A { public: void DoSomethingBLike() const {} }; void UseAnA(A const& some_A) { some_A.DoSomethingALike(); } void SomeFunc() { B b; UseAnA(b); // b can be substituted for an A. }
Overloading (Functions, Operators) [C++]
Overloading means that you are assigning more than one name for the same function or operator in the same scope.
Example I found showing Function Overloading.
#include <iostream> using namespace std; void print(int i) { cout << " Here is int " << i << endl; } void print(double f) { cout << " Here is float " << f << endl; } void print(char* c) { cout << " Here is char* " << c << endl; } int main() { print(10); print(10.10); print("ten"); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
Here is int 10 Here is float 10.1 Here is char* ten
Exception Handing (throw, try, catch) [C++]
An exception in programming is when a program has a situation that has an unexpected circumstance that happens in that section of the programs code. To handle these exceptions their are programming keywords in place like (throw, try, and catch).
catch is used as a preemptive guard against exceptions.
throw is used as a handler after and exception has occurred and tells the program to get rid of or throw the bad segment or unexpected circumstance for the section of code.
try is used as a handler for after an exception is realized as well and instead just telling the program to toss the bad line or code out it gives an instance of instead to try.
Templates, STL (Standard Template Library) [C++]
The Standard Template Library is made of predefined class for C++ and provides components called algorithms, containers, functional, and iterators.
I already filled this out twice