0%

Funtion Definition

The return value cannot be an array. Everything else is possible. (Interestingly, even though a C++ function can’t return an array directly, it can return an array that is part of a structure or object.)

Read more »

Arrays

Declaring an array:

typeName arrayName[arraySize]

arraySize must be a integer constant, const value or const expression, for which all values are known at compilation time. In particular, arraySize cannot be a variable whose value is set at run time.

If need to dynamically allocate an array at run time, use new or malloc.

Read more »

Executing tasks in threads

The first step in organizing a program around task execution is identifying sensible task boundaries. Ideally, tasks are independent activities: work that doesn’t depend on the state, result, or side effects of other tasks. Independence facilitates concurrency, as independent tasks can be executed in parallel if there are adequate processing resources.

Read more »