Thursday, February 5, 2015

Not so frequently used keywords c++

alignas, alignof, and_eq, asm, auto, bitand, bitor, catch, char16_t, char32_t, compl,  constexpr, const_cast, decltype, dynamic_cast, enum, explicit, export, inline, mutable,  noexcept, not_eq, nullptr, operator, or_eq, protected, register, reinterpret_cast, short, signed, sizeof, static_assert, static_cast, template, this, thread_local, throw, try,  typeid, typename, union, unsigned, using, virtual, volatile, wchar_t, xor, xor_eq

Very important: The C++ language is a "case sensitive" language. 

Storage classes

The storage for variables with global or namespace scope is allocated for the entire duration of the program. This is known as static storage, and it contrasts with the storage for local variables (those declared within a block). These use what is known as automatic storage. The storage for local variables is only available during the block in which they are declared; after that, that same storage may be used for a local variable of some other function, or used otherwise.

But there is another substantial difference between variables with static storage and variables with automatic storage:
- Variables with static storage (such as global variables) that are not explicitly initialized are automatically initialized to zeroes.
- Variables with automatic storage (such as local variables) that are not explicitly initialized are left uninitialized, and thus have an undetermined value.

Source: C++ tutorial

No comments:

Post a Comment