In this section,
we'll talk about keywords, identifiers,
punctuation operators and syntax in programming languages.
Most languages have keywords.
Keywords are part of the vocabulary of a programming language
in most languages. The keywords are also reserved.
This means that you, the programmer,
cannot redefine their meaning and you can't use them in a way in which there were not intended.
C++ has lots of keywords
in a browser. I've opened up a webpage for CPP reference.com
that lists the C++ keywords
without a frame of reference. It's difficult to know that this is a lot of keywords.
There are around 90 keywords in C++.
Java has around 50 --
has 32 and Python has 33.
90 is a lot of keywords.
Now in general, the more keywords that a language has,
the more complex the programming language grammar.
However, there are many keywords in C++ that are rarely used.
I've been using C++ for a very long time.
And there are some keywords in this list that I've never used.
There's no need to sit down and memorize all these keywords.
We'll use the keywords as we need them. You'll learn that along the way.
Notice that some of the keywords in this list we've already used. For example,
we've used it and we've used return. Here and here's
return right here.
We use that in our first program.Also noticed that pound include
main, favorite number, standard endline,
cin and cout are not in this list.
That's because they're not keywords. We'll talk about them. Next.
What's important to remember here
is that C++ has a set of keywords that it's defined in the language.
And these words are reserved.
Now let's go to code light and see the reserve words in our first program.
Back in code light. And I'm looking at the same program that we did in the previous section.
The moment, the favorite number, you can see that I mentioned that
main and pound include
and favorite number and so forth.
We're not keywords. Same with standard out,
see out and so forth and inline all of these.
These are not keywords. These are called identifiers.
And there's an important distinction between identifiers and keywords
and identifier is something that the programmer names.
So these names have been created by programmers
to create something that represents something meaningful to them.
There are rules about how to name identifiers and we'll go into all those in a later section C++
also has operators has got a lot of operators.
It's got the operators that you used to, you know, your addition,
multiplication, subtraction, division, and so forth.
But in this case, we're using some non-standard operators,for example.
This guy right here, that little Chevron
is the stream insertion operator.
We're going to insert whatever's on the right-hand side of it, into that stream.
In this case, it's an output stream that gets displayed to the console.
Same thing with the string extraction operator.
One takes something from the console and stores it into a variable
in this case.
Favorite number
there's also that double colon right here.
That's the scope resolution operator.
We'll talk about all of these operators as we go on to section nine in the course,
C++ also has punctuation
things like semi-colons at the end of statements, curlies
open and closed quotes, parentheses.It's got all kinds of punctuation.
When you put all of these elements together in a program,
you end up with something called syntax.
Syntax is the syntax of the programming language, the structure,
and the meaning of what you want the compiler to understand
the compiler is taking your code and translating it to machine code.
And it's translating it based on what you told that you wanted to be done.
It's not going to guess. This may sound a little intimidating at this point,
but it comes pretty quickly with a little bit of practice.
Well, that completes this video in the next video.
We'll talk about the seatbelt plus preprocessor
and we'll learn more about that.Pre-processor directive pound include.