Difference between "const text[]" and "text[]"?
#2

Prevent arrays from being modified, with that const.

Код:
stock fail(const msg[])
{
    msg[0] = '0';
}
It will not be changed.

And it will cause error and warning:
Код:
error 022: must be lvalue (non-constant)
warning 215: expression has no effect
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)