Inline Functions in C++

Calling a function has a performance penalty because you have to create variables, specify scope, pause the current variables and push data onto the call stack, just to name a few reasons. C++ allows you to define an inline function, which should be short, to improve the performance. In doing so, the compiler will actually…

Sizing in CSS

In order to bring in the space between the edge of one element (the browser for example) and another, we have to understand sizing. All sizing is done through a series of unit measurements. Depending upon what you are creating will depend upon what unit you are wanting to choose. Some units are based upon…

Default Arguments

C++ has added the ability to have default arguments be defined when you declare your functions. To define a default value, you must specify the parameter name, and then assign it a value. If someone calls this function without passing an argument to the function, the computer will use 20 as the parameter. If they…

Function Prototypes

In previous examples, we’ve had to write our functions above the place where they are called. However, many developers like to place main as their first function they see, so it’s easier to find. Or they may not know the order that the function will be called. C and C++ allow you to define a…

Overloading a Function

Overloading a function means that you can create different functions with the same name, as long as their signatures are different. That means that the parameter list must be of a different number and/or data types from one to another. Overloading functions can make reading code much clearer/easier. This way functions that perform the same…