Welcome all to this tutorial.
Today I will go ahead and begin the crash course C++
Keep in mind that we will mainly learn things that will be of to us in order to create a keylogger
but before we can get into the creation of the keylogger
we have to go through some basic things
so that you would actually understand the code that you see before yourselves
I will give you fairly good explanations of what I am doing here
and of some basic terms that you will need
and then later on, as we keep on progressing through the creation of the keylogger
you will learn more and more and more and more
until eventually you pretty much figure it all out.
Now let's go ahead and begin, shall we?
Last time you saw a program hello world run printed out
something onto the screen now let's see let's let's let's go ahead and try to
understand the first of all you have this includes statement here and it says
basically iostream include your including libraries and other things
yeah so libraries and other things I know how it sounds
believe me that is all you need to know for the time being basically the
contents of this file just comes in front of the main function and it's
taken into consideration by the program why do we need this well so that we can
write see out we wouldn't be able to rate see out without iostream also slash
slash is a comment line so it just means that that particular line will not be
taken into consideration by the system that's just something that we use as
reference for our cells and four other people who read through the code you can
also use multi comment multi-line comments like this just write in a
stream
/ Asterix and then at the end rate in Asterix / and that all that intersection
will be taken will be taken out of the consideration by the machine over here
you see it immediately says that it immediately gives you a red underline of
see out doesn't recognize it because we have commented out this library so let's
go ahead and delete this and see out is perfectly fine and dandy now except it's
missing a few things that we will take in now so tape in less and less than
sign a pin
hey hey it is for its 4 o'clock at my place now and awake if we just go ahead
and press Enter
2010 we need a semicolon Germany and Karen 02 pretty much finished program go
ahead and take press Ctrl F 11 to Reddit and every code it says hey it is 4
o'clock at my place and it's for plucked my place now and I am awake so we've
successfully managed to print this onto the screen now weekend go ahead and play
around with it a little bit of a pin and Elton sir a new line but you need lesser
then lets you then and we can also do this this the simple fact that we
pressed enter here does not mean that program into the new line this is just
purely for aesthetic purposes for us it makes no difference whatsoever
machine until we actually tell us and you line with and L and now we can go
in Western Western Cape in another sentence why awake now so that's it
going through going through there we go
says you have the initial state you have the initial sentence which is here and
then you have and L and then you have this just to make a point here
delete or if I just a pin can tell if I just commented out can do dis going
through and you see now it's a single line it makes no difference whatsoever
to replace this section in a different line here until we actually tell the
program so that would be see out that's how you print something out now they're
now if you want to insert something into the system if you want to emphasize
something healthy certainly if you want to put something you would use see in
but before we can actually go into sea in just talking about a concept which is
common to all programming languages which is variables which variables
variables are memory locations allocated in ran that's their used in order to
store data basically you have a lot of variables see a lot of variable types
let's put it so that the correct way of putting it
you have in low flow there are there are there are others training and so on and
so forth
we're gonna get to do no worries there but for the time being
let's deal with it so integers it just basically just whole numbers meaning
12345 1010 billion in five
11 something like that so does would be integers let's let's get let's create an
interview so in a equals then semicolon and I could have also done this the
equals 20 all these places they're just Julie first for aesthetic reasons
they're not needed by the program by the machine you also have another variable
type which is a double those are numbers with the small points so fight AP in C
equals ten-point 10.3% AP in D
the equals 62234 those would be doubles next up if I type in Sialkot they close
attention here- see out enter the values for a and B give it and we'll see and
greater Denver greater than sign that in mind and then we shall taken co2
values of a and B value of a space less than less than and L because we would
like a new line of value apps be and we need to do this so value of a is a and
value of b is basically be and we don't really needed here so I just go ahead
and put it like this icon and let's go ahead and run the program
existent required project now this is how well aside from just knowing that
scenario where tells you that you go and take a look at the code and you go and
take a look at the lines close to the one where you have a red X mark so let's
see what what sort of mistake did we meet here so first thought can you
spotted just take a look it's in this line for sure it doesn't always the
Sunni to be it can be in the preceding lines lines that come afterwards but
take a look in see out is that of using less than less than we used greater
denigrated n so just changed out and it should run now so enter the values for
A&B go ahead and tape in 50 and then take pain
30 value fee is 50 value of b is 38 UCC AC even do we have assigned values we
could have we've reassigned be reassigned him with user input so the
user has placed seven different values here and we can also changed is to be a
bit premier just a entered value and to develop you of a just and after you have
entered the value of a you can hear
ok so rigid and greeted n entered the value be and do dis yeah we will need
and L and I will explain in a moment
CNNA and now we need to enter B C in B let's run the program to see if
everything works well it says enter the value of a but since replaced and the
new lie here maybe that wasn't the brightest the fight years ok and enter
the value of b which is going to be no it so it's as the value of a stand value
of b is eighty so made a slight slip up in aesthetics here we can feel free to
remove death part and have a prettier output
value fee one of B will be to go anyway what did we do here we rode see how to
print something out to screen so console out and see in console in and we've
printed out onto screen enter the value of a and since we didn't actually type
in any new alliance printing like that here the next position to enter anything
would be simply straight effort to text you saw the output when I typed in and
tell you has taken the value below the text next up you have seen in ages
consul in to improve the value of a you are asking the user to input and the
program is standing by for the user to input about you down below
again we've printed out and to the value of b and it's just new lines for
anything of a kind so it's waiting for the input of the user again with see it
once the boat once both values have been entered we are able to print out of
value of a is a value of b be so if something is in the quotation marks like
this we are just drinking debt out the screen
no big deal there but if we just put a variable legged is the value of that
very the value that is stored in that variable will be printed out so the
value that is stored in a at this point of time at this point of time into code
is whatever the user inputs before the user input its then because we have a
slide then and then we had the user has actually reassigned something else to
the value we didn't need to write them here
printing of a kind we could have just left it like this
this some garbage would be stored into A&B because something always has to be
within those variables anyway that be
user input with CNN and user output and standard output with C out we can go
ahead and well we don't necessarily to delete them we will as we should recycle
the code as much as we can so use the code if we've already taken somewhere in
the same time but oh well
gonna miss out on something now next up we have math operators so what Matt
operators do you have in the real world basically the same thing here plus minus
you have division multiplication and you also have a modulus if you don't know
what modulus is basically when you divide two numbers and whatever remains
that the modules for example if you divide that number number five with
number to the result would be the result will be basically two with the remainder
of one that's one way of looking at it that remainder one that would be the
modulus a way we will use these shortly but other than that but you also have
any comparison operators so the comparison operators are equal equal
which means that we can put it like this
a is equal all to be we are we can use a conditional statement if I will talk
about that shortly but I just wanna do this first so a equals equals be which
means equal be if I just typed in 11 equation 1
11
equal sign a equals be all I would do with this quite literally is a sign the
value of B to A and that's it
huge mistake usually made by pretty much everybody people will be going for
twenty years they still make these mistakes cuz they literally have to
stare at millions of lines of code so it's a common area don't worry about it
next up we have exclamation mark equals which means a is not equal to be in a
min rated in a is great libby is no less than BB and that's pretty much it also
has also have things like and and and and which basically stands for the word
and if you have some pole and then be and these can be some sort of conditions
a is not equal 0 to see and be is not in B is equal this would basically stayed
at this and this if you have example by buy it for me in this or this so or
some very simple things there you can use them in if statements which are
conditional statements basically this obscure focus on if a is equal to be and
and then see is not equal to D then I would like you to announce see well not
leap and if this else if that is not so I would like to see out I will fight
against leaf semicolon here and we need a semicolon here so do you see the logic
of this basically and stadium if this condition of a Louise the true and it
will only evaluate the true if a is equal to be and he is not equal to D
this will be printed out and this will be disregard however this evaluates to
false so if either of these conditions do conditions are not true so if a is
different from being if let's say 10 and bees 2010 you're gonna go ahead and
execute this part the code and disregard this part could have also placed the or
logical or here so this would mean that only one of these two conditions would
have to be true in order for this portion of the code
to run well shoot an example of this in default store