Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
terralib:convencaoprograma [2008/04/02 16:08] laercio |
terralib:convencaoprograma [2008/04/02 16:22] (current) laercio |
||
---|---|---|---|
Line 130: | Line 130: | ||
} | } | ||
</code> | </code> | ||
+ | |||
Line 136: | Line 137: | ||
* Use C++ casting operators instead of C-style casts. Ex:<code cpp> | * Use C++ casting operators instead of C-style casts. Ex:<code cpp> | ||
- | short a=2000; | + | short a = 2000; |
int b; | int b; | ||
b = (int) a; // c-like cast notation - Ok only for fundamental data types | b = (int) a; // c-like cast notation - Ok only for fundamental data types | ||
- | double d=3.14159265; | + | double d = 3.14159265; |
int i = static_cast<int>(d); // No need for this cast | int i = static_cast<int>(d); // No need for this cast | ||
</code> | </code> |