2. Data Types, Variables, Identifiers

Veröffentlicht am: 09 August 2020
auf dem Kanal: Everything_Programming
114
3

This Video is our first look at variables and how to declare and initialize variables. We'll be going over identifier naming rules and the overall syntax on how to appropriately declare variables. Then we will do a practice program at the end

Names for variables, functions, macros, and other entities are called identifiers
An identifier may contain letters, digits, and underscores, but must begin with a letter or underscore
C is case-sensitive: it distinguishes between upper-case and lower-case letters in identifiers.

1. only lower-case letters in identifiers, with underscores inserted for legibility:
symbol_table current_page name_and_address•
2. Use an upper-case letter to begin each word within an identifier:
symbolTable currentPage nameAndAddress

We use variables to store data during program execution
You need to declare a variable (need to create memory space) before you can use a variable
Every variable must have a type.
C has a wide variety of types, but today we will focus on the int and double types
int data types are used for integer values (whole numbers)
double data type are used for values that require decimal places

We use variables to store data during program execution
You need to declare a variable (need to create memory space) before you can use a variable
Every variable must have a type.
C has a wide variety of types, but today we will focus on the int and double types
int data types are used for integer values (whole numbers)
double data type are used for values that require decimal places

Initial value of a variable may be included in its declaration:
int height = 8;
Any number of variables can be initialized in the same declaration:
int height = 8, length = 12, width = 10;
Each variable requires its own initializer.int height, length, width = 10;
/* initializes only width */


Auf dieser Seite können Sie das Online-Video 2. Data Types, Variables, Identifiers mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Everything_Programming 09 August 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 114 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!