Data Types in C Language :
C Language is rich in its data type. data types means to identify the types
of data that are you want to be create and used. There are different data types
in C Language are -:
1. Fundamental (Built-in) Data type.
2. User define Data types
3. Derived Datatypes
When
programming, we store the variables in our computer's memory, but the computer
has to know what kind of data we want to store in them since it is not going
to occupy the same amount of memory to store a simple number than to store a
single letter or a large number, and they are not going to be interpreted the same way. The memory in our computers is organized in bytes. A byte is the minimum amount of memory that we can manage in C. A byte can store a relatively
small amount of data: In addition, the computer can manipulate more complex
data types that come from grouping several bytes, such as long numbers or
non-integer numbers.
You have a summary
of the basic fundamental data types in C as well as the range of values that can
be represented with each one in Table 2.a:
Name
|
Size
|
Range
|
Char
|
1byte
|
signed: -128 to 127
unsigned: 0 to 255
|
Int
|
2 byte
|
signed: -32768 to 32767
unsigned: 0 to 65535
|
floate
|
4 byte
|
+/- 3.4e +/- 38 (~7 digits )
|
double
|
8
byte
|
+/- 1.7e +/- 308 (~15 digits)
|
long int
|
4 byte
|
signed:
-2147483648 to 2147483647
unsigned: 0 to 4294967295
|
char- char data type is used to define a character variable that holds the
single character.
int - int data type is used to define the integer variables.
float – float data type is used to define the
decimal variables
User
Defined Data types in C Language-
There
are such data type that are defined by the user is called as user define data
types.
1 .
Structure
2 .
Union
3 .
enum
Derived Data Type in C Language: -
Derived data
type are given below
1. Array
– It is a collection of similar types that is homogenies element.
2. Pointer-
A pointer is a variable that store the address of another variable.
3. Reference-
A reference is a alternative name for an object are used to create a reference.
4. Function-:
A function is a method name that are invoked anywhere in a program.
What is the fee
ReplyDelete