-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lesson.StackAndHeap.cs
75 lines (55 loc) · 1.67 KB
/
Lesson.StackAndHeap.cs
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
using System;
namespace ConsoleApp7
{
public partial class Lesson
{
public static void StackAndHeapExample()
{
bool hasPhoto = true;
int adultAge = 18;
int age = 18;
string name = "Olga";
string surname = "Pupkina";
string address = "Минск, Кропоткина 55, оф. 50";
string workingAddress = address;
}
public static void TypeFromConvertExample()
{
string flat = "34";
int flatNuber = int.Parse(flat);
int flatNuber2 = Convert.ToInt32(flat);
//int flatNuber3 = int.Parse("ewe");
//int flatNuber4 = Convert.ToInt32("sdfdf");
//int flatNumber = flat;
char sex = 'М';
//string sexstrin = sex;
int sexInt = sex;
string sexstrin = Convert.ToString(sex);
char place = '3';
int place2 = place;
double percent = 75.5;
int prersent = (int)percent;
int weight = 55;
float weihtInt = weight;
}
public static void TypeToConvertExample()
{
int flat = 34;
string sex = "М";
int percent = 75;
double weight = 55.0f;
}
public static void TypeConvertExample()
{
string flat = "34";
char sex = 'М';
double percent = 75.5;
int weight = 55;
int flat2;
string sex2;
int precent2;
double weight2;
//TODO: Do converting.
}
}
}