Tutorial by Examples

An example of a constraint as expressed in the C standard is having two variables of the same name declared in a scope1), for example: void foo(int bar) { int var; double var; } This code breaches the constraint and must produce a diagnostic message at compile time. This is very usef...
The unary + and - operators are only usable on arithmetic types, therefore if for example one tries to use them on a struct the program will produce a diagnostic eg: struct foo { bool bar; }; void baz(void) { struct foo testStruct; -testStruct; /* This breaks the constraint so mu...

Page 1 of 1