"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
3 data-types-in-c
1.
2. Programs transform data from one form to another
◦ Input data Output data
◦ Stimulus Response
Programming languages store and process data in
various ways depending on the type of the data;
consequently, all data read, processed, or written by
a program must have a type
Two distinguishing characteristics of a programming
language are the data types it supports and the
operations on those data types
3. A data type is
◦ A set of values AND
◦ A set of operations on those values
A data type is used to
◦ Identify the type of a variable when the variable is declared
◦ Identify the type of the return value of a function
◦ Identify the type of a parameter expected by a function
4. When the compiler encounters a declaration for a
variable, it sets up a memory location for it
An operator used on a variable or variables is legal
only if
◦ The operator is defined in that programming language for a
variable of that type
◦ The variable or variables involved with the operator are of the
same or compatible types
5. Capital letters A-Z, lowercase letters a-z,
digits 0-9, and the underscore character
First character must be a letter or underscore
Usually only the first 32 characters are
significant
There can be no embedded blanks
Keywords cannot be used as identifiers
Identifiers are case sensitive
Identifiers refer to the names of data types, constants,
variables, and functions
6. Built-in data types
◦ Fundamental data types (int, char, double,
float, void, pointer)
◦ Derived data types (array, string, structure)
Programmer-defined data types
◦ Structure
◦ Union
◦ Enumeration
7. void – used to denote the type with no values
int – used to denote an integer type
char – used to denote a character type
float, double – used to denote a floating point
type
int *, float *, char * – used to denote a
pointer type, which is a memory address type
8. int elevationIndicator;
char inputSymbol;
float totalCost;
int main (void)
{
double grossProduct;
int *temperatureValuePtr;
grossProduct = 4567.89;
inputSymbol = 'a';
return (0);
} // End main
9. Array – a finite sequence (or table) of
variables of the same data type
String – an array of character variables
Structure – a collection of related variables of
the same and/or different data types. The
structure is called a record and the variables in
the record are called members or fields
10. int elevationTable[20];
char inputSymbols[] = "Hello World";
struct operationsStruct
{
double heatReading;
int temperatureValue;
float speedMeter;
char actionCode;
}; // End struct
struct operationsStruct currentOperations;