home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day11 / strucarr.c < prev    next >
MacBinary  |  2002-05-02  |  1.5 KB  |  [TEXT/LMAN]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu May 2 22:37:50 2002, modified Thu May 2 22:37:50 2002, creator 'LMAN', type ASCII, 912 bytes "strucarr.c" , at 0x410 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[LMAN]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 73 74 72 75 63 61 | 72 72 2e 63 00 00 00 00 |..struca|rr.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4c 4d 41 | 4e 00 00 ff ff ff ff 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 03 90 00 | 00 01 1e b8 f7 a8 7e b8 |........|......~.|
|00000060| f7 a8 7e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..~.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 1d a1 00 00 |........|........|
|00000080| 2f 2a 20 44 65 6d 6f 6e | 73 74 72 61 74 65 73 20 |/* Demon|strates |
|00000090| 75 73 69 6e 67 20 61 72 | 72 61 79 73 20 6f 66 20 |using ar|rays of |
|000000a0| 73 74 72 75 63 74 75 72 | 65 73 2e 20 2a 2f 0d 0a |structur|es. */..|
|000000b0| 0d 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |..#inclu|de <stdi|
|000000c0| 6f 2e 68 3e 0d 0a 0d 0a | 2f 2a 20 44 65 66 69 6e |o.h>....|/* Defin|
|000000d0| 65 20 61 20 73 74 72 75 | 63 74 75 72 65 20 74 6f |e a stru|cture to|
|000000e0| 20 68 6f 6c 64 20 65 6e | 74 72 69 65 73 2e 20 2a | hold en|tries. *|
|000000f0| 2f 0d 0a 0d 0a 73 74 72 | 75 63 74 20 65 6e 74 72 |/....str|uct entr|
|00000100| 79 20 7b 0d 0a 20 20 20 | 20 63 68 61 72 20 66 6e |y {.. | char fn|
|00000110| 61 6d 65 5b 32 30 5d 3b | 0d 0a 20 20 20 20 63 68 |ame[20];|.. ch|
|00000120| 61 72 20 6c 6e 61 6d 65 | 5b 32 30 5d 3b 0d 0a 20 |ar lname|[20];.. |
|00000130| 20 20 20 63 68 61 72 20 | 70 68 6f 6e 65 5b 31 30 | char |phone[10|
|00000140| 5d 3b 0d 0a 7d 3b 0d 0a | 0d 0a 2f 2a 20 44 65 63 |];..};..|../* Dec|
|00000150| 6c 61 72 65 20 61 6e 20 | 61 72 72 61 79 20 6f 66 |lare an |array of|
|00000160| 20 73 74 72 75 63 74 75 | 72 65 73 2e 20 2a 2f 0d | structu|res. */.|
|00000170| 0a 0d 0a 73 74 72 75 63 | 74 20 65 6e 74 72 79 20 |...struc|t entry |
|00000180| 6c 69 73 74 5b 34 5d 3b | 0d 0a 0d 0a 69 6e 74 20 |list[4];|....int |
|00000190| 69 3b 0d 0a 0d 0a 69 6e | 74 20 6d 61 69 6e 28 20 |i;....in|t main( |
|000001a0| 76 6f 69 64 20 29 0d 0a | 7b 0d 0a 0d 0a 20 20 20 |void )..|{.... |
|000001b0| 20 2f 2a 20 4c 6f 6f 70 | 20 74 6f 20 69 6e 70 75 | /* Loop| to inpu|
|000001c0| 74 20 64 61 74 61 20 66 | 6f 72 20 66 6f 75 72 20 |t data f|or four |
|000001d0| 70 65 6f 70 6c 65 2e 20 | 2a 2f 0d 0a 0d 0a 20 20 |people. |*/.... |
|000001e0| 20 20 66 6f 72 20 28 69 | 20 3d 20 30 3b 20 69 20 | for (i| = 0; i |
|000001f0| 3c 20 34 3b 20 69 2b 2b | 29 0d 0a 20 20 20 20 7b |< 4; i++|).. {|
|00000200| 0d 0a 20 20 20 20 20 20 | 20 20 70 72 69 6e 74 66 |.. | printf|
|00000210| 28 22 5c 6e 45 6e 74 65 | 72 20 66 69 72 73 74 20 |("\nEnte|r first |
|00000220| 6e 61 6d 65 3a 20 22 29 | 3b 0d 0a 20 20 20 20 20 |name: ")|;.. |
|00000230| 20 20 20 73 63 61 6e 66 | 28 22 25 73 22 2c 20 6c | scanf|("%s", l|
|00000240| 69 73 74 5b 69 5d 2e 66 | 6e 61 6d 65 29 3b 0d 0a |ist[i].f|name);..|
|00000250| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 | |printf("|
|00000260| 45 6e 74 65 72 20 6c 61 | 73 74 20 6e 61 6d 65 3a |Enter la|st name:|
|00000270| 20 22 29 3b 0d 0a 20 20 | 20 20 20 20 20 20 73 63 | ");.. | sc|
|00000280| 61 6e 66 28 22 25 73 22 | 2c 20 6c 69 73 74 5b 69 |anf("%s"|, list[i|
|00000290| 5d 2e 6c 6e 61 6d 65 29 | 3b 0d 0a 20 20 20 20 20 |].lname)|;.. |
|000002a0| 20 20 20 70 72 69 6e 74 | 66 28 22 45 6e 74 65 72 | print|f("Enter|
|000002b0| 20 70 68 6f 6e 65 20 69 | 6e 20 31 32 33 2d 34 35 | phone i|n 123-45|
|000002c0| 36 37 20 66 6f 72 6d 61 | 74 3a 20 22 29 3b 0d 0a |67 forma|t: ");..|
|000002d0| 20 20 20 20 20 20 20 20 | 73 63 61 6e 66 28 22 25 | |scanf("%|
|000002e0| 73 22 2c 20 6c 69 73 74 | 5b 69 5d 2e 70 68 6f 6e |s", list|[i].phon|
|000002f0| 65 29 3b 0d 0a 20 20 20 | 20 7d 0d 0a 0d 0a 20 20 |e);.. | }.... |
|00000300| 20 20 2f 2a 20 50 72 69 | 6e 74 20 74 77 6f 20 62 | /* Pri|nt two b|
|00000310| 6c 61 6e 6b 20 6c 69 6e | 65 73 2e 20 2a 2f 0d 0a |lank lin|es. */..|
|00000320| 0d 0a 20 20 20 20 70 72 | 69 6e 74 66 28 22 5c 6e |.. pr|intf("\n|
|00000330| 5c 6e 22 29 3b 0d 0a 0d | 0a 20 20 20 20 2f 2a 20 |\n");...|. /* |
|00000340| 4c 6f 6f 70 20 74 6f 20 | 64 69 73 70 6c 61 79 20 |Loop to |display |
|00000350| 64 61 74 61 2e 20 2a 2f | 0d 0a 0d 0a 20 20 20 20 |data. */|.... |
|00000360| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|00000370| 34 3b 20 69 2b 2b 29 0d | 0a 20 20 20 20 7b 0d 0a |4; i++).|. {..|
|00000380| 20 20 20 20 20 20 20 20 | 20 70 72 69 6e 74 66 28 | | printf(|
|00000390| 22 4e 61 6d 65 3a 20 25 | 73 20 25 73 22 2c 20 6c |"Name: %|s %s", l|
|000003a0| 69 73 74 5b 69 5d 2e 66 | 6e 61 6d 65 2c 20 6c 69 |ist[i].f|name, li|
|000003b0| 73 74 5b 69 5d 2e 6c 6e | 61 6d 65 29 3b 0d 0a 20 |st[i].ln|ame);.. |
|000003c0| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 | |printf("|
|000003d0| 5c 74 5c 74 50 68 6f 6e | 65 3a 20 25 73 5c 6e 22 |\t\tPhon|e: %s\n"|
|000003e0| 2c 20 6c 69 73 74 5b 69 | 5d 2e 70 68 6f 6e 65 29 |, list[i|].phone)|
|000003f0| 3b 0d 0a 20 20 20 20 7d | 0d 0a 0d 0a 20 20 20 20 |;.. }|.... |
|00000400| 72 65 74 75 72 6e 20 30 | 3b 0d 0a 7d 0d 0a 0d 0a |return 0|;..}....|
|00000410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000490| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|000004a0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|000004b0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|000004c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+