Strings

3 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
€86.76
List Price:  €121.47
You save:  €34.70
£74.30
List Price:  £104.03
You save:  £29.72
CA$137.31
List Price:  CA$192.24
You save:  CA$54.93
A$154.56
List Price:  A$216.40
You save:  A$61.83
S$128.58
List Price:  S$180.02
You save:  S$51.44
HK$784.94
List Price:  HK$1,098.95
You save:  HK$314
CHF 81.78
List Price:  CHF 114.50
You save:  CHF 32.71
NOK kr1,010.33
List Price:  NOK kr1,414.50
You save:  NOK kr404.17
DKK kr647.29
List Price:  DKK kr906.23
You save:  DKK kr258.94
NZ$167.41
List Price:  NZ$234.39
You save:  NZ$66.97
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,235.59
List Price:  ৳17,130.31
You save:  ৳4,894.72
₹8,659.29
List Price:  ₹12,123.35
You save:  ₹3,464.06
RM425.20
List Price:  RM595.30
You save:  RM170.10
₦154,995.49
List Price:  ₦216,999.89
You save:  ₦62,004.40
₨28,388
List Price:  ₨39,744.33
You save:  ₨11,356.33
฿3,277.22
List Price:  ฿4,588.24
You save:  ฿1,311.02
₺3,966.92
List Price:  ₺5,553.85
You save:  ₺1,586.92
B$551.22
List Price:  B$771.73
You save:  B$220.51
R1,857.08
List Price:  R2,599.99
You save:  R742.90
Лв169.60
List Price:  Лв237.45
You save:  Лв67.84
₩137,302.64
List Price:  ₩192,229.19
You save:  ₩54,926.55
₪348.05
List Price:  ₪487.29
You save:  ₪139.23
₱5,716.62
List Price:  ₱8,003.50
You save:  ₱2,286.87
¥14,609.03
List Price:  ¥20,453.23
You save:  ¥5,844.20
MX$1,917.22
List Price:  MX$2,684.19
You save:  MX$766.96
QR364.88
List Price:  QR510.85
You save:  QR145.97
P1,348.42
List Price:  P1,887.85
You save:  P539.42
KSh12,918.70
List Price:  KSh18,086.70
You save:  KSh5,168
E£5,060.78
List Price:  E£7,085.29
You save:  E£2,024.51
ብር13,757.66
List Price:  ብር19,261.28
You save:  ብር5,503.61
Kz91,186.38
List Price:  Kz127,664.58
You save:  Kz36,478.20
CLP$94,106.58
List Price:  CLP$131,752.98
You save:  CLP$37,646.40
CN¥717.91
List Price:  CN¥1,005.11
You save:  CN¥287.19
RD$5,927.29
List Price:  RD$8,298.45
You save:  RD$2,371.15
DA13,025.47
List Price:  DA18,236.17
You save:  DA5,210.70
FJ$225.97
List Price:  FJ$316.37
You save:  FJ$90.39
Q768.93
List Price:  Q1,076.53
You save:  Q307.60
GY$20,930.90
List Price:  GY$29,304.10
You save:  GY$8,373.19
ISK kr12,369.18
List Price:  ISK kr17,317.35
You save:  ISK kr4,948.16
DH913.16
List Price:  DH1,278.46
You save:  DH365.30
L1,710.84
List Price:  L2,395.25
You save:  L684.40
ден5,341.90
List Price:  ден7,478.87
You save:  ден2,136.97
MOP$808.93
List Price:  MOP$1,132.54
You save:  MOP$323.60
N$1,806.34
List Price:  N$2,528.95
You save:  N$722.60
C$3,681.79
List Price:  C$5,154.65
You save:  C$1,472.86
रु13,857.80
List Price:  रु19,401.48
You save:  रु5,543.67
S/359.26
List Price:  S/502.98
You save:  S/143.71
K418.28
List Price:  K585.61
You save:  K167.33
SAR375.19
List Price:  SAR525.28
You save:  SAR150.09
ZK2,340.73
List Price:  ZK3,277.11
You save:  ZK936.38
L436.45
List Price:  L611.05
You save:  L174.60
Kč2,153.60
List Price:  Kč3,015.13
You save:  Kč861.52
Ft34,926.02
List Price:  Ft48,897.82
You save:  Ft13,971.80
SEK kr966.73
List Price:  SEK kr1,353.46
You save:  SEK kr386.73
ARS$116,307.06
List Price:  ARS$162,834.54
You save:  ARS$46,527.48
Bs691.30
List Price:  Bs967.84
You save:  Bs276.54
COP$408,260.26
List Price:  COP$571,580.70
You save:  COP$163,320.43
₡50,508.48
List Price:  ₡70,713.90
You save:  ₡20,205.41
L2,612.93
List Price:  L3,658.21
You save:  L1,045.27
₲798,531.84
List Price:  ₲1,117,976.52
You save:  ₲319,444.68
$U4,090.68
List Price:  $U5,727.12
You save:  $U1,636.43
zł371.42
List Price:  zł520
You save:  zł148.58
Already have an account? Log In

Transcript

Hello, welcome to the tutorial on the c++ programming series. And this problem in looking at strings. strings, as the name suggests, is just basically a piece of text that allows you to do stuff when you create a variable, which is what we're going to be doing. And unlike the other variables that we've created, so in flow, double, Boolean, etc, it has its own hash include basically its own header, its own file. And this is actually a class it's not you create an object string object on like a variable, but it also has its own function strings are a lot more powerful than int, char Boolean or what have you. So let's just go ahead and open up that project.

Okay, so let's get rid of this line for a second. And I first thought sorry we need to include the strength header so it's literally just called string in angle brackets these angle brackets are for when you're including a library file and you use quotation marks okay these when you include in like a custom file, but we'll get on to that later on in this series. Um so to create is part of the standard namespace they need to do STD colon colon or or pH but using namespace std and then you do string name of the string on the input s then bracket bracket and inside here you just put what you want to have inside this variable from for Hello this is a grain STD s STD nine semicolon that run it. And we have the string printer. Yes, but what we can also do if we do ask doc to access this objects method is a bunch of methods, open Fs, MTA raise stuff, but we're gonna look at length.

So if we do have, we run it and it says 22 characters. It's also includes basic sort of, it's counting 1-234-567-8910 1112 1314 1516 1718 1920 212 and two. So yeah, as I said, it does include spacey sort of bear in mind when you use this. But there's so many more functions there's a ridiculous amount. And yeah, there's a sorry service. Just run that the same again.

Don't remove the main file, systems, anything else? Interesting that we can as quickly show you in this tutorial we're gonna see string will basically sort of printed out at a char string. So this is useful for stuff that will take maybe in her char array. But yeah, that's it for strings in the next tutorial we're going to look at constants which are similar to variable but that are constant. If you have any questions, feel free to message us at support at sonar system.com. Okay, the email will be in the description.

You can comment on this video which is directly messages via YouTube. Whatever you feel comfortable with. All the requirements for source code will also be in the description. And as usual, thank you 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.