2 ms·
It doesn't even have to be static. Const is powerful when used on non-pointer types. You can write something like this and the compiler will (on appropriate opt
by PhilipRoman 3y ago
It doesn't even have to be static. Const is powerful when used on non-pointer types. You can write something like this and the compiler will (on appropriate optimization levels) hard-code return value to 7777 regardless of what "mutate" does:
extern void mutate(int *p);
int func() {
const int foo = 7777;
mutate(&foo);
return foo;
}