How to Use Expressions and Statements in C++ Video
  1. Tech

Your suggestion is on its way!

An email with a link to:

was emailed to:

Thanks for sharing with others!

Video:How to Use Expressions and Statements in C++

with Bulk Item

An 'expression' is something that is evaluated, and has an output to test if it's true or false. In this video, learn what an expression and statement is in C++.See Transcript

Transcript:How to Use Expressions and Statements in C++

Hi, my name is Matt from and I am here today for to explain about expressions and statements in C++.

What is an Expression in C++?

An expression is something that is evaluated and has an output or is tested to be either true or false. For example, if I make an expression one equals two, it will evaluate it to false. And these expressions are used to test conditions in C++ and to make decisions.

What is a Constant?

Now, a constant is a value defined. They should not be confused with variables where you assign values. Constants are values that you set at the beginning and that will never change. Now, time conversions are quite important in C++ because if you are going to be going between one type of variable and another, you need to be able to convert them accurately.

If I was to cast a double to an integer, I am going to lose degrees of precision. And so having converted my times, having compared them with expressions, having used constants in my expressions I need to be aware that there is an operator precedence and the various operators, plus, minus, divide, multiply, are carried out in a certain order. We do not simply read the expression from left to right, but we evaluate it in the order of operators.

My name is Matt, thanks for watching, for more information you can go to the C and C++ website.

About videos are made available on an "as is" basis, subject to the User Agreement.

©2015 All rights reserved.