Docsity

C++ Programming Basics – Variables, Keywords and Number System Notes, Summaries of Computer Science

Partial preview of the text

Download C++ Programming Basics – Variables, Keywords and Number System Notes and more Summaries Computer Science in PDF only on Docsity!

Variables are containers for storing data values. In C++, there are different types of variables (defined with different keywords), for example: ¢ int - stores integers (whole numbers), without decimals, such as 123 or -123 * double - stores floating point numbers, with decimals, such as 19.99 or -19.99 ® char - stores single characters, such as ‘a’ or 'B'. Char values are surrounded by single quotes « string - stores text, such as "Hello World". String values are surrounded by double quotes * bool - stores values with two states: true or false 1 Keywords(also known as reserved words) have special meanings to the C++ compiler and are always written or typed in short(lower) cases. * Keywords are words that the language uses for a special purpose, such as void, int, public, etc. * It can’t be used for a variable name or function name or any other identifiers. The total count of reserved keywords is 95. 32 Keywords in C++ Language which Is also available In C language. auto doupie ine struct break ene tong switcn case enum register typecer const Noat snort unsignea conunue for signea vora geraur goto sizeot votatie go « static write Another 30 reserved words that were not in C, these are new to G++ asm dynamic_cast namespace reinterpret_cast boot expen new static_cast catcn raise operator tempiate class friend private this const_cast inne pusne tnrow aetete mutapie protected te try rypeia typename using using wirtuan wenart Note: you can not use these keyword for variable and not overload TYPES OF NUMBER SYSTEM ber Syst Decimal Binary octaL Number system number system Number system numbe t wers Wit base 10 base 2 102)jo, (2 Hexadecimal Number system mpers with