Const
1. Konstante Variable
const int * x;
2. Konstante Pointer
int * const x;
3. Verwenung von const in Funktionen
int berechne(const int a)
{
return (a*5 - 3);
};
{
return (a*5 - 3);
};
Effekt:
- Der Compiler kann aufgrund dieser Information ggf. besser optimieren! Gehen sie großzügig damit um.
Voraussetzung:
- Sie wollen die Variable nicht innerhalb der Funktion ändern
Siehe auch C
There are no comments on this page. [Add comment]