-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathType_Storage.cs
More file actions
107 lines (69 loc) · 3.59 KB
/
Type_Storage.cs
File metadata and controls
107 lines (69 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp12
{
internal class Program
{
static void Main(string[] args)
{
/*
in the bigning of learn C# , you need to Know about type and
learning C# consists of learning how to create and use types
some of the type is a simple type like (int , long, shurt...) can store only a single data item.
other type is can store multiply item like (Array)
*/
/*
Data type
We have three part of the Data type
1- Reference Data Types : require two segments (part) of memory .
The first contains the actual data and is always located in the heap.
The second is a reference that points to where the data is stored in the heap.
(For reference types, the actual data is stored in the heap, and the reference is stored on the stack)
2- Value Data type : require only a single segment (part) of memory, which stores the actual data.
(for value type Data is stored on the stack )
3- Pointer Data Type: that points to an address of a value,
We can say that the symbols used are Pointer Data Type such as & and *
Stack and Heap
when an program is running, its data must be stored in memory ,where and how it’s stored?
A running program uses two part of memory to store data: the stack and the heap.
stack
Stack is a special type of collection that stores elements in LIFO (Last In First Out)
LIFO means The last item added can be removed first.
And addition items is called push and deviation items is called pop.
Heap
It is an area of memory allocated to store certain kinds of data objects.
In it data can be stored and removed in any order.
here Garbage Collection removes all items that do nothing or have no origin.
There are 2 types of "Value data type" in C# language
Predefined Data Types and Users defined Data Types
Predifine data
__________________
Numeric
1- Intiger
( sbyte ,byte ,short ,ushort ,int , uint ,long),
2- Floting point( decimal,float,double))
Non Numeric
(bool,char )
Users difine data
___________________
Enum type
Struct type
There are 2 types of "Reference data type" in C# language
Predefined Data Types and Users defined Data Types
Predifine data
__________________
Object
String
Daynamic
Users difine data
___________________
Class
Interface
Delegate
*/
}
}
}