13 hours 15 minutes
Now we're going to do an example. So we're going to define a string, and then we're gonna print off that string, and then we'll modify it and we'll print off the modified string.
So I got my editor here. I've already created my project, which we also know how to do.
So let's define our string.
Okay, So I define my characters, put on end
of string here until Terminator
No, go ahead and friended off. So we should know how to do this movie a X. Hello?
Call print string.
It will call Brent
Okay, so now what I want to do is I want to modify it. So I'm going to change the w from a lower case w to an uppercase w So again, move my address into the A X.
And then if we calculate, we can see that the word hello has five letters and then there's a space so six
So we're going to add ta x, The number six.
There we go
and then we'll go ahead and move a bite into that location. So
I only want to write one bite
the value at e X
and I'm gonna change that to an uppercase W. And so I put a lower case W. And now I've modified that
So the Nike again can move into ea X the value of hello,
String and the new line.
So I go ahead and modify that, and then I'll go ahead and print off my string again.
So we'll go ahead and build it
so we can see that we printed off the original, and then we modified it by figuring out our offsets and go ahead and changing that.
So today we talked about in director address ing.
We created some variables. We modified some variables, and then we modified a string using offsets.
So here's a quiz
given the following. So we have a segment in our segment, data we have Hello. And then this is a test.
So you should think about how do you get the address of the variable? Hello?
And how do you get the data at the location? Hello.
You can pause a lecture.
So to get the address of the variable holo where you don't use the brackets and to get the data at that location, you do use the brackets.
So, looking forward, we're gonna talk about the stack,
and then if you have questions, you can contact me at Miller MJ at you and Kate. I e d u. And you can find me on Twitter at Milhouse 30.