Jump to content

Featured Replies

Posted

coralkashri.jpegWe all know that every ΓÇÿ,ΓÇÖ matters in this language, so I decided to talk directly about that character today. So, how much impact can be for such a small little character?

ItΓÇÖs just ΓÇÿ,ΓÇÖ ΓÇô The Comma Operator

by Coral Kashri

From the article:

This operator comes from C, where it tells the compiler to evaluate all the expressions (left to right) and to return the result of the latest evaluated expression. For example:
     int a, b;
     a = 5, b = 4, b += a, ++a, std::cout << b << " " << a; // Prints 9 6

Another example of that operator usage is as follows:

     for (size_t i = 0, k = 500; i < 10; ++i, ++k) { /*...*/ }
 
We can see this operator in action in the third section of the for statement. It evaluates the ++i and then evaluates ++k.

View the full article

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.