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 */
Sur cette page du site, vous pouvez voir la vidéo en ligne 2. Data Types, Variables, Identifiers durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Everything_Programming 09 août 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 114 fois et il a aimé 3 téléspectateurs. Bon visionnage!