Type Aliasing

2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€85.85
List Price:  €120.20
You save:  €34.34
£75.29
List Price:  £105.42
You save:  £30.12
CA$139.53
List Price:  CA$195.35
You save:  CA$55.82
A$151.91
List Price:  A$212.69
You save:  A$60.77
S$129.50
List Price:  S$181.31
You save:  S$51.80
HK$778.39
List Price:  HK$1,089.78
You save:  HK$311.38
CHF 80.17
List Price:  CHF 112.24
You save:  CHF 32.07
NOK kr1,009.31
List Price:  NOK kr1,413.07
You save:  NOK kr403.76
DKK kr641.25
List Price:  DKK kr897.78
You save:  DKK kr256.52
NZ$174.13
List Price:  NZ$243.80
You save:  NZ$69.66
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,191.62
List Price:  ৳17,068.76
You save:  ৳4,877.13
₹9,019.51
List Price:  ₹12,627.67
You save:  ₹3,608.16
RM412.50
List Price:  RM577.52
You save:  RM165.02
₦144,457.55
List Price:  ₦202,246.35
You save:  ₦57,788.80
₨28,185.33
List Price:  ₨39,460.59
You save:  ₨11,275.26
฿3,192.33
List Price:  ฿4,469.39
You save:  ฿1,277.06
₺4,244.10
List Price:  ₺5,941.91
You save:  ₺1,697.81
B$533.64
List Price:  B$747.12
You save:  B$213.48
R1,710
List Price:  R2,394.08
You save:  R684.07
Лв167.98
List Price:  Лв235.18
You save:  Лв67.20
₩146,538.35
List Price:  ₩205,159.56
You save:  ₩58,621.20
₪324.13
List Price:  ₪453.80
You save:  ₪129.66
₱5,891.26
List Price:  ₱8,248
You save:  ₱2,356.74
¥15,560.70
List Price:  ¥21,785.61
You save:  ¥6,224.90
MX$1,826.45
List Price:  MX$2,557.10
You save:  MX$730.65
QR364.65
List Price:  QR510.53
You save:  QR145.87
P1,333.36
List Price:  P1,866.76
You save:  P533.39
KSh12,943.70
List Price:  KSh18,121.70
You save:  KSh5,178
E£4,751.35
List Price:  E£6,652.08
You save:  E£1,900.73
ብር15,409.57
List Price:  ብር21,574.01
You save:  ብር6,164.44
Kz91,216.93
List Price:  Kz127,707.36
You save:  Kz36,490.42
CLP$92,386.76
List Price:  CLP$129,345.16
You save:  CLP$36,958.40
CN¥706.37
List Price:  CN¥988.95
You save:  CN¥282.58
RD$6,298.13
List Price:  RD$8,817.64
You save:  RD$2,519.50
DA13,013.32
List Price:  DA18,219.18
You save:  DA5,205.85
FJ$226.58
List Price:  FJ$317.23
You save:  FJ$90.64
Q764.28
List Price:  Q1,070.03
You save:  Q305.74
GY$20,873.29
List Price:  GY$29,223.44
You save:  GY$8,350.15
ISK kr12,774.72
List Price:  ISK kr17,885.12
You save:  ISK kr5,110.40
DH923.18
List Price:  DH1,292.49
You save:  DH369.31
L1,699.07
List Price:  L2,378.77
You save:  L679.69
ден5,295.87
List Price:  ден7,414.43
You save:  ден2,118.56
MOP$800.14
List Price:  MOP$1,120.23
You save:  MOP$320.08
N$1,708.62
List Price:  N$2,392.14
You save:  N$683.51
C$3,671.47
List Price:  C$5,140.21
You save:  C$1,468.73
रु14,362.10
List Price:  रु20,107.51
You save:  रु5,745.41
S/336.50
List Price:  S/471.11
You save:  S/134.61
K422.99
List Price:  K592.21
You save:  K169.21
SAR375.24
List Price:  SAR525.35
You save:  SAR150.11
ZK2,292.25
List Price:  ZK3,209.25
You save:  ZK916.99
L436.93
List Price:  L611.72
You save:  L174.79
Kč2,071.96
List Price:  Kč2,900.84
You save:  Kč828.87
Ft32,683.18
List Price:  Ft45,757.76
You save:  Ft13,074.58
SEK kr939.74
List Price:  SEK kr1,315.68
You save:  SEK kr375.93
ARS$145,633.56
List Price:  ARS$203,892.81
You save:  ARS$58,259.25
Bs689.44
List Price:  Bs965.25
You save:  Bs275.80
COP$379,711.65
List Price:  COP$531,611.50
You save:  COP$151,899.85
₡49,130.59
List Price:  ₡68,784.79
You save:  ₡19,654.20
L2,628.55
List Price:  L3,680.08
You save:  L1,051.52
₲691,938.08
List Price:  ₲968,741
You save:  ₲276,802.91
$U3,934.14
List Price:  $U5,507.95
You save:  $U1,573.81
zł363.22
List Price:  zł508.52
You save:  zł145.30
Already have an account? Log In

Transcript

Hello, welcome to the 43rd tutorial in the c++ programming series. And in this problem we are looking at type aliasing type. aliasing allows you to assign names or essentially keywords to different types in c++. So for example, you could assign the name f to the keyword flow. So instead of using the keyword float, to create flower, we could just use a new type alias, aka F. But you can still use float as well. It doesn't eliminate that current show you type aliasing.

It's actually something that I personally don't really use, but it's a feature of c++ and it's please worth teaching and it's up to you whether you want to use it so we just do type def, we just type in the word type def, and you type in the existing keyword for float. f because that's what we wanted. That's the alias we want to assign to it. So instead Creating a variable with keyword flow we can just use f name a variable variable that's very creative that we can see knowing. Now we just do STD C and variable STD. And now if we run this we get 9.8.

But if we just change this to the key still works obviously still with the original keyword it doesn't eliminate that by any means. Alternatively you can also use this they both do the same thing you can do using f equals it does exactly the same thing as type def. But again, it's up to you whichever one you want to you don't have to comment this one I personally prefer this one if I were to, you know, just pick a little just because of how it looks. But again, that's totally up to you. That's it for this part. In the next part of this series we'll be looking at Union if you have any questions, feel free to message us at support at solar systems Dakota, UK, the email will be in the description you can comment on the videos directly messages via YouTube, or the recording for source code will be in the description.

And as usual, thanks for watching and I hope you have a nice day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.