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
€87.14
List Price:  €122
You save:  €34.86
£75.29
List Price:  £105.41
You save:  £30.12
CA$137.33
List Price:  CA$192.27
You save:  CA$54.93
A$141.80
List Price:  A$198.53
You save:  A$56.72
S$128.26
List Price:  S$179.57
You save:  S$51.31
HK$783.27
List Price:  HK$1,096.61
You save:  HK$313.34
CHF 79.54
List Price:  CHF 111.36
You save:  CHF 31.82
NOK kr958.19
List Price:  NOK kr1,341.51
You save:  NOK kr383.31
DKK kr651.09
List Price:  DKK kr911.55
You save:  DKK kr260.46
NZ$171.92
List Price:  NZ$240.70
You save:  NZ$68.77
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,287.30
List Price:  ৳17,202.71
You save:  ৳4,915.41
₹9,325.70
List Price:  ₹13,056.36
You save:  ₹3,730.65
RM393.91
List Price:  RM551.49
You save:  RM157.58
₦136,279.37
List Price:  ₦190,796.57
You save:  ₦54,517.20
₨27,955.36
List Price:  ₨39,138.62
You save:  ₨11,183.26
฿3,286.67
List Price:  ฿4,601.47
You save:  ฿1,314.80
₺4,431.56
List Price:  ₺6,204.36
You save:  ₺1,772.80
B$524.65
List Price:  B$734.54
You save:  B$209.88
R1,691.56
List Price:  R2,368.26
You save:  R676.69
Лв170.44
List Price:  Лв238.62
You save:  Лв68.18
₩149,919.27
List Price:  ₩209,892.98
You save:  ₩59,973.70
₪311.64
List Price:  ₪436.31
You save:  ₪124.66
₱6,013.19
List Price:  ₱8,418.71
You save:  ₱2,405.51
¥15,910.69
List Price:  ¥22,275.60
You save:  ¥6,364.91
MX$1,779.28
List Price:  MX$2,491.07
You save:  MX$711.78
QR365.84
List Price:  QR512.19
You save:  QR146.35
P1,364.45
List Price:  P1,910.29
You save:  P545.83
KSh12,958.70
List Price:  KSh18,142.70
You save:  KSh5,184
E£5,222.91
List Price:  E£7,312.29
You save:  E£2,089.37
ብር15,710.10
List Price:  ብር21,994.78
You save:  ብር6,284.67
Kz91,203.97
List Price:  Kz127,689.21
You save:  Kz36,485.24
CLP$91,407.85
List Price:  CLP$127,974.65
You save:  CLP$36,566.80
CN¥689.98
List Price:  CN¥966
You save:  CN¥276.02
RD$6,082.91
List Price:  RD$8,516.33
You save:  RD$2,433.41
DA13,238.41
List Price:  DA18,534.30
You save:  DA5,295.89
FJ$221.85
List Price:  FJ$310.60
You save:  FJ$88.75
Q767.07
List Price:  Q1,073.94
You save:  Q306.86
GY$20,949.93
List Price:  GY$29,330.74
You save:  GY$8,380.81
ISK kr12,478.75
List Price:  ISK kr17,470.75
You save:  ISK kr4,992
DH941.49
List Price:  DH1,318.13
You save:  DH376.63
L1,752.37
List Price:  L2,453.39
You save:  L701.02
ден5,371.73
List Price:  ден7,520.65
You save:  ден2,148.91
MOP$808.41
List Price:  MOP$1,131.81
You save:  MOP$323.39
N$1,679.42
List Price:  N$2,351.26
You save:  N$671.83
C$3,679.63
List Price:  C$5,151.64
You save:  C$1,472
रु14,857.69
List Price:  रु20,801.36
You save:  रु5,943.67
S/343.57
List Price:  S/481.02
You save:  S/137.44
K434.10
List Price:  K607.76
You save:  K173.66
SAR375.47
List Price:  SAR525.67
You save:  SAR150.20
ZK1,958.19
List Price:  ZK2,741.54
You save:  ZK783.35
L444.15
List Price:  L621.83
You save:  L177.68
Kč2,135.46
List Price:  Kč2,989.72
You save:  Kč854.26
Ft34,228.72
List Price:  Ft47,921.58
You save:  Ft13,692.86
SEK kr939.65
List Price:  SEK kr1,315.54
You save:  SEK kr375.89
ARS$139,437.37
List Price:  ARS$195,217.90
You save:  ARS$55,780.52
Bs691.96
List Price:  Bs968.77
You save:  Bs276.81
COP$371,588.45
List Price:  COP$520,238.70
You save:  COP$148,650.24
₡46,992.08
List Price:  ₡65,790.80
You save:  ₡18,798.71
L2,655.43
List Price:  L3,717.71
You save:  L1,062.28
₲647,191.03
List Price:  ₲906,093.33
You save:  ₲258,902.30
$U4,049.61
List Price:  $U5,669.62
You save:  $U1,620
zł372.90
List Price:  zł522.07
You save:  zł149.17
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.