• 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.
Auf dieser Seite können Sie das Online-Video 4. Introduction to c++: Variable and data types summary: Basic Programming for Beginners mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer DigitalStage 18 August 2012 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 9,846 Mal angesehen und es wurde von 102 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!