Why is the following syntax not legal?
Code:struct additives { char* milk[7]; = { "Skimmed", "Frothy", "half-skim", "Cream" }; };
Why is the following syntax not legal?
Code:struct additives { char* milk[7]; = { "Skimmed", "Frothy", "half-skim", "Cream" }; };
First might be the misplaced semicolon. Second might be that types don't have values, objects do -- so you cannot initialize a type. Create an object of your type and provide an initialization there instead. Maybe something like this.
Code:struct additives { char* milk[7]; }; struct additives Object = { { "Skimmed", "Frothy", "half-skim", "Cream" } };
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*