Content deleted Content added
No edit summary |
No edit summary |
||
Line 11:
Many find it convenient to draw a distinction between the terms "declaration" and "definition", as in the commonly seen phrase "the distinction between a ''declaration'' and ''definition''...", implying that a declaration merely designates a data object (or function). In fact, according to the [[C++ standard]], a definition ''is'' a declaration. Still, the usage "declarations and definitions", although formally incorrect, is common.<ref>''C++ FAQs'', by Cline, Lomow, and Girou, Addison-Wesley, 1999, ISBN 0-201-30983-1.</ref>
C/C++ Examples:
<!-- each example deserves a separate treatment,
but I don't know how to keep a proper balance
Line 18:
<source lang="c">
int i = 0;
int i2(0);▼
int k[4] = {0, 1};
int j[2] = {rand(), k[0]};▼
char tx[3]="fa";
char ty[2]="fa";
</source>
C++ only examples:
<source lang="c">
▲int i2(0);
▲int j[2] = {rand(), k[0]};
MyClass* xox = new MyClass (0, "zaza");
struct point {int x; int y;} p = {rand(), i};
|