CATEGORII DOCUMENTE |
Asp | Autocad | C | Dot net | Excel | Fox pro | Html | Java |
Linux | Mathcad | Photoshop | Php | Sql | Visual studio | Windows | Xml |
Associated with, but distinct from, the problems of real-time programming are sequence points. These are the Standard's attempt to define when certain sorts of optimization may and may not be permitted to be in effect. For example, look at this program:
#include <stdio.h>Example 8.6
The compiler might want to optimize the loop so that i_var
can be stored in a machine
register for speed. However, the function needs to have access to the correct
value of i_var
so that it
can print the right value. This means that the register must be stored back
into i_var
at each function
call (at least). When and where these conditions must occur are
described by the Standard. At each sequence point, the side effects of all
previous expressions will be completed. This is why you cannot rely on
expressions such as:
because there is no sequence point specified for
the assignment, increment or index operators, you don't know when the effect of
the increment on i
occurs.
The sequence points laid down in the Standard are the following:
&&
operator.
operator. ?
conditional operator. auto
object. do
, while
, if
, switch
or for
statements. The expression in a return
statement.
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 770
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved