We've already talked about operators and operator precedence, which is very important to figure out how expressions will be evaluated and there's quite a few levels of operator precedence. We've already seen four or five of these. I want to go into a little more detail on this. So I'm going to put up the complete operator precedence table for the C language. We see it here, founded on the web, it's a nice version. There are many, this copyright, William Swanson. Notice what he says about the table, operator precedence describes the order in which C reads expressions. For example, expression a 4 plus b times 2, contains two arithmetic operators actually, technically there's the assignment operator as well. An addition and a multiplication, so there are actually three with assignment. Which comes first? Well, the 4 plus b does not get evaluated for a start would be a left-to-right order which isn't the case, times has the highest precedence. So first whatever b's value would be, would be multiplied by two and then the four would be added to the result. Now there's also a notion of associativity, where these things associate left to right, which is what some operators do when others go right to left. So let's look at the different levels. There are something called primary expression operators. Those include postscript plus plus, postscript minus minus, the auto increment and auto decrement operators. It also includes something we will use later, which is indexing, and also includes function call, which we've already seen when we call main. Then there are a bunch of unary operators, they have the next highest precedence, and among them is star,, which in this case means dereferencing. We won't see that until much later in this course or the next course. Also address of, which we've seen with scan f. The unary plus and the unary minus. So you see plus and minus here and those are binary. So you unary minus and unary plus bind more tightly, have higher precedence than the binary operators. So you could say plus b plus a and the plus b while in effect is a no op, is first, do this unary plus operation which doesn't have much value. Then there's a logical negation negation, very important especially in logical and relational expressions. Then there's the prefix auto increments and auto decrements. We'll see later that we need typecasting. We also will have a special operation called size of, which gets us the size of some expression, how it's stored, how many bytes. Here we have operators we've already used a fair amount, we've had times, divide, divide's actually two operators. It could be integer divide or floating point divide and modulo. Here are the binary plus and minus, and then below it are some bit shift operators and then relation operators less than, greater than, greater than equal or less than equal. Then equality and inequality, the logical is a equal to b or is a not equal to b. Then the bitwise operator ampersand, which is different than the usup here. So one thing that's confusing about C, is the overuse of symbols. So you have to understand a symbol in the context. So this is a bit wise and, this is an address of and, and we'll see later ampersand ampersand as a logical and just as these two side arrows are logical or whereas this is a bit shift and this is also a bit wise operation. We won't get to use a lot of these operators especially the bitwise operations they're rather advanced, you should know about them. [inaudible] is a fancy ternary operators, it's ternary because that's three arguments. We'll get to see it shortly, but again it's a bit esoteric. Finally, we have these assignment operators, the normal one. Just a sign. Then plus assignment minus assignment times assignment etc. Finally, we have the lowest precedence operator which is a comma operator which is associating left to right. The comma operator is quite interesting, though again it shouldn't be used too often because it's fairly subtle and it means first evaluate in a left to right order the first expression and then go to the next expression and then go to the next expression. So also the comma operator forces a sequence of evaluation which is sometimes useful. To make sure you understand how these things work at least and things you've already used up to now. You should be able to do what's 3 times 5. That's pretty easy, I'll tell you is 15. Now what's 3 times 5 plus 2, here you have to know that the plus 2 is added on later. Times goes first. Now you can override precedence with parenthesizations. So 3 times 5 plus 2 is different than 3 times 5 plus 2. However, you could also have had parenth 3 times parenth 5 plus 2, and that would have just reinforced the implicit ordering already. So again, you can work through a bunch of these, just make sure you understand how they work, how to do the order of evaluation. Here's that funky 8, is it equal to plus 8, remember this plus is a unary plus. Then here we get into the difference between integer divide, 3 integer divide 5 versus 3.0, which is a literal double constant that's taken from the doubles divide five, and you should understand why these give different results. Okay. We'll also do the quiz on this.