Searching for: Methods in C++
Ternary Operator
Language: C++

The ternary operator is used to execute code based on the result of a binary condition. It takes in a binary condition as input, which makes it similar to an 'if-else' control flow block. It also, however, returns a value, behaving similar to a method.

Functions
Language: C++

A function is a block of code that can be called from another location in the program or class. It is used to reduce the repetition of multiple lines of code. The return statement concludes the execution of the block of code. The function can either return a value (of dataType, declared in the function header), or return nothing (use the 'void' dataType). Within classes, functions are known are 'Methods'.

Array
Language: C++

Arrays are used to assign a series of elements of the same type in consecutive memory locations; to define a list of elements. They work similar to variables, except they contain multiple values at different indices.

Class Declaration & Structure
Language: C++

Classes are a blueprint for creating individual objects that contain the general characteristics of a defined object type.


< Previous Page   |   Next Page >