|
|
1.1 root 1:
2:
3: struct C Keyword struct
4:
5:
6:
7:
8: Data type
9:
10:
11: struct is a C keyword that introduces a structure. The following
12: is an example of how struct can be used in the description of a
13: name and address file:
14:
15:
16: struct address {
17: char firstname[10];
18: char lastname[15];
19: char street[25];
20: char city[10];
21: char state[2];
22: char zip[5];
23: int salescode;
24: };
25:
26:
27: _T_h_e _C _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, ed. 2 prohibits the assignment of
28: structures, the passing of structures to functions, and the
29: returning of structures by functions. COHERENT, however, lifts
30: these restrictions. It allows one structure to be assigned to
31: another, provided the two structures are of the same type. It
32: also allows structures to be passed by and returned by functions.
33: These features are supported by most compilers, but users should
34: be aware that their use can cause problems in porting code to
35: some compilers.
36:
37: ***** See Also *****
38:
39: array, C keywords, field, structure
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.