answersLogoWhite

0

The comma operator will let you use multiple statements in an expression in C or C++.

Strictly speaking, you cannot have a statement inside an expression, for example the following is completely wrong:

int n;

n = 1 + for (i=0; i

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Can a while statement end in a semicolon?

Yes. A while statement ends in a statement...while (expression) statement...and that statement can be a null statement, a single statement, or a block of statements. In the case of the block of statements, there is also a set of braces surrounding them...while (expression);while (expression) statement;while (expression) {statement1;statement2;...statementN;}In the case where the body of the statement is null, there is no body. This is often done while taking advantage of side effects. For instance, to copy a string you could use...char *strcpy (char *pszDestination, char *pszSource) {char *pszTemp = pszDestination;while ((*pszDestination++ = *pszSource++) != '\0');return pszTemp;}...this works because the post-increment (++) operator has higher precedence than the dereference (*) operator, and because the assignment (=) operator has the value of the assignment, which is compared using the not equal (!=) operator against the string terminator null.Note, carefully, the inner parentheses. They are needed because != has higher precedence than =, and you want it the other way around. Also, some compilers will let you eliminate the != '\0' terms and the inner parentheses, but that is not portable, and most compilers will warn you about assignment in a conditional expression.In the case of a single statement you could use...i= -1;while (++i < argc) printf ("%d %s\n", i, argv[i]);...here the while statement also ends in a semicolon.The case of the block of statements is not shown, because it seems to be understood from the context of the question.


What do actors right before the camera operator starts to shoot?

do all questions get let through? Is this a statement that actors only function onstage but can't live their lives?


Let a me ask you question is this a question or statement?

this is a question. how can you make , are there any reasons to drink and drive? , into a statement? Let me ask you a question. Is a statement but, Let me ask you a question is this a question or a statement? Is a question.


Is Let me ask you a question a question or a statement?

this is a question. how can you make , are there any reasons to drink and drive? , into a statement? Let me ask you a question. Is a statement but, Let me ask you a question is this a question or a statement? Is a question.


How do you get to a math statement...let statement?

work it left to right then insert ie


A number multiplied by 8 algebraic expression?

Let the number be x and so the expression is 8x


What the expression for a number decreased by 19?

Let the number be x and so the expression is: x-19


What is a let statement?

It is a statement that shows a value of a variable or constant within sentences. For EX: A number less than 7 is 3 LET STATEMENT: four less than seven is 3.


What is associatively of operator?

In simple, For operators, associativity means that when the same operator appears in a row, then to which direction the evaluation binds to. In the following, let Q be the operator a Q b Q c If Q is left associative, then it evaluates as (a Q b) Q c And if it is right associative, then it evaluates as a Q (b Q c) It's important, since it changes the meaning of an expression. Consider the division operator with integer arithmetic, which is left associative 4 / 2 / 3 &lt;=&gt; (4 / 2) / 3 &lt;=&gt; 2 / 3 = 0 If it were right associative, it would evaluate to an undefined expression, since you would divide by zero 4 / 2 / 3 &lt;=&gt; 4 / (2 / 3) &lt;=&gt; 4 / 0 = undefined


What is the algebraic expression of 12 more than a number?

Let the unknown number be x and so the expression is: x+12


Expressionmeaning of To let down your hair?

The expression ''let your hair down'' means be free and bold.


What expression represents an unknown number increased by 10?

Let x be the unknown number. the expression is: x + 10.