4. Introduction to c++: Variable and data types summary: Basic Programming for Beginners

Published: 18 August 2012
on channel: DigitalStage
9,846
102

   • 4. Introduction to c++: Variable and data ...  

4. Introduction to c++: Basic Programming for beginners: Summary to variables and Data Types in c++

This is the third video in the series of videos for basic programming skill in c++.

This video basically introduces what are the variables and variable identifiers in c++, how are they used and why are they important and also how to use them to make a program more useful.

Key terms:
Variable: Portion of memory to store and determine a certain value.
Valid identifier: sequence of letters, numbers and underscore, and cannot start with number. Can start with underscore(_) but not recommended.
Reserved keywords: That are there already for compiler to use and we declaring them will just try to initialize again causing error.
List of reserved keywords:
asm, auto, bool, break, case, catch, char, class, const, const_cast, continue, default, delete, do, double, dynamic_cast, else, enum, explicit, export, extern, false, float, for, friend, goto, if, inline, int, long, mutable, namespace, new, operator, private, protected, public, register, reinterpret_cast, return, short, signed, sizeof, static, static_cast, struct, switch, template, this, throw, true, try, typedef, typeid, typename, union, unsigned, using, virtual, void, volatile, wchar_t, while

Operator words that may be reserved:
and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq

List of fundamental data type:
=================================
|| Type || Size || Range ||
==================================
|| char || 1 byte || signed: -128 to 127 ||
|| || || unsigned: 0 to 255 ||
==================================
|| short int || 2 bytes || signed: -32768 to 32767
|| (short) || || unsigned: 0 to 65535




==================================
|| int || 4bytes || signed: -2147483648 to 2147483647
|| || || unsigned: 0 to 4294967295
============================================
|| long int || 4bytes || signed: -2147483648 to 2147483647
|| (long) || || unsigned: 0 to 4294967295
============================================
|| bool || 1byte || true or false
============================================
|| float || 4bytes || +/- 3.4e +/- 38 (~7 digits)
============================================
|| double || 8bytes || +/- 1.7e +/- 308 (~15 digits)
============================================
|| long || 8bytes ||+/- 1.7e +/- 308 (~15 digits)
|| double ||
============================================
|| wchar_t || 2/4 bytes|| 1 wide character
============================================

Variables can be initialized basically in two ways:
examples:
int a = 10;
or
int a (10);

string variable types can store bunch of characters.


On this page of the site you can watch the video online 4. Introduction to c++: Variable and data types summary: Basic Programming for Beginners with a duration of hours minute second in good quality, which was uploaded by the user DigitalStage 18 August 2012, share the link with friends and acquaintances, this video has already been watched 9,846 times on youtube and it was liked by 102 viewers. Enjoy your viewing!