C Programming Tutorial 30 - Intro to Operators

submitted by mkenny400 on 03/19/18 1

In this video we are going to be discussing operators. Now, the simplest examples of operators are the arithmetic operators. Think of something like this:   5 + 5   The + sign is called an operator, and each of the two integers are called operands. The entire thing is called an expression.   But why does it really matter? Haven't we already discussed how to do math in C like a million videos ago? Well the reason I am discussing operators more now is because there are actually many operators in C. There are so many that we are going to be spending the next section of videos discussing all of the different operators that are available to us. And no, not all operators are used for math. When we get into more complicated math, we tend to use what are known as functions, rather than operators.   The easiest way to start thinking about operators is to separate them into groups. You know we gotta group everything!   We can group the operators by the number of operands they work on. So the + operator has two operands, the first number and the second number. Operators with 2 operands are called binary operators. The other two classifications of operators are unary operators, which only work on one operand, and ternary operators, which work on three operands.   As we go through the operators, I want you to resist the urge to assume that operators change the values of stuff, because only a few do.   For example, if we have the expression x + 5, the value of x does not get changed by 5. The value of x always stays the same. This may seem obvious now, but as we get into some other operators keep this in mind. The ones that change values I will explicitly tell you that they do.   Grouping by number of operands can be helpful, but there is a more useful grouping that I am going teach you about. That is grouping the operators by function. For example, the + in 5 + 5 is part of the arithmetic operators.   Arithmetic operators is just one category of many operators. These are used for arithmetic. There are also relational operators, assignment operators, logical operators, and so forth.   So throughout the next section of videos you will likely see me using both classifications. So for example, + is a binary arithmetic operator. This allows you to understand a lot about the operator before you even start learning what it does.   In the next video we are going to be discussing all of the arithmetic operators. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! www.patreon.com/calebcurry Subscribe to my newsletter: eepurl.com/-8qtH Donate!: bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: CalebCurry.com Facebook: www.facebook.com/CalebTheVideoMaker Google+: plus.google.com/+CalebTheVideoMaker2 Twitter: twitter.com/calebCurry Amazing Web Hosting - www.dreamhost.com/r.cgi?1487063 (The best web hosting for a cheap price!)

Leave a comment

Be the first to comment

Collections with this video
Email
Message
×
Embed video on a website or blog
Width
px
Height
px
×
Join Huzzaz
Start collecting all your favorite videos
×
Log in
Join Huzzaz

facebook login
×
Retrieve username and password
Name
Enter your email address to retrieve your username and password
(Check your spam folder if you don't find it in your inbox)

×