home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day09 / passing.c < prev    next >
MacBinary  |  2002-04-27  |  1.4 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, Sat Apr 27 15:25:20 2002, modified Sat Apr 27 15:25:20 2002, creator 'LMAN', type ASCII, 835 bytes "passing.c" , at 0x3c3 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 09 70 61 73 73 69 6e | 67 2e 63 00 00 00 00 00 |..passin|g.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 43 00 | 00 01 1e b8 f0 ab a0 b8 |......C.|........|
|00000060| f0 ab a0 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 4a 41 00 00 |........|....JA..|
|00000080| 2f 2a 20 50 61 73 73 69 | 6e 67 20 61 6e 20 61 72 |/* Passi|ng an ar|
|00000090| 72 61 79 20 74 6f 20 61 | 20 66 75 6e 63 74 69 6f |ray to a| functio|
|000000a0| 6e 2e 20 2a 2f 0d 0a 0d | 0a 23 69 6e 63 6c 75 64 |n. */...|.#includ|
|000000b0| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0d 0a 0d 0a 23 |e <stdio|.h>....#|
|000000c0| 64 65 66 69 6e 65 20 4d | 41 58 20 31 30 0d 0a 0d |define M|AX 10...|
|000000d0| 0a 69 6e 74 20 61 72 72 | 61 79 5b 4d 41 58 5d 2c |.int arr|ay[MAX],|
|000000e0| 20 63 6f 75 6e 74 3b 0d | 0a 0d 0a 69 6e 74 20 6c | count;.|...int l|
|000000f0| 61 72 67 65 73 74 28 69 | 6e 74 20 6e 75 6d 5f 61 |argest(i|nt num_a|
|00000100| 72 72 61 79 5b 5d 2c 20 | 69 6e 74 20 6c 65 6e 67 |rray[], |int leng|
|00000110| 74 68 29 3b 0d 0a 0d 0a | 69 6e 74 20 6d 61 69 6e |th);....|int main|
|00000120| 28 20 76 6f 69 64 20 29 | 0d 0a 7b 0d 0a 20 20 20 |( void )|..{.. |
|00000130| 20 2f 2a 20 49 6e 70 75 | 74 20 4d 41 58 20 76 61 | /* Inpu|t MAX va|
|00000140| 6c 75 65 73 20 66 72 6f | 6d 20 74 68 65 20 6b 65 |lues fro|m the ke|
|00000150| 79 62 6f 61 72 64 2e 20 | 2a 2f 0d 0a 0d 0a 20 20 |yboard. |*/.... |
|00000160| 20 20 66 6f 72 20 28 63 | 6f 75 6e 74 20 3d 20 30 | for (c|ount = 0|
|00000170| 3b 20 63 6f 75 6e 74 20 | 3c 20 4d 41 58 3b 20 63 |; count |< MAX; c|
|00000180| 6f 75 6e 74 2b 2b 29 0d | 0a 20 20 20 20 7b 0d 0a |ount++).|. {..|
|00000190| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 | |printf("|
|000001a0| 45 6e 74 65 72 20 61 6e | 20 69 6e 74 65 67 65 72 |Enter an| integer|
|000001b0| 20 76 61 6c 75 65 3a 20 | 22 29 3b 0d 0a 20 20 20 | value: |");.. |
|000001c0| 20 20 20 20 20 73 63 61 | 6e 66 28 22 25 64 22 2c | sca|nf("%d",|
|000001d0| 20 26 61 72 72 61 79 5b | 63 6f 75 6e 74 5d 29 3b | &array[|count]);|
|000001e0| 0d 0a 20 20 20 20 7d 0d | 0a 0d 0a 20 20 20 20 2f |.. }.|... /|
|000001f0| 2a 20 43 61 6c 6c 20 74 | 68 65 20 66 75 6e 63 74 |* Call t|he funct|
|00000200| 69 6f 6e 20 61 6e 64 20 | 64 69 73 70 6c 61 79 20 |ion and |display |
|00000210| 74 68 65 20 72 65 74 75 | 72 6e 20 76 61 6c 75 65 |the retu|rn value|
|00000220| 2e 20 2a 2f 0d 0a 20 20 | 20 20 70 72 69 6e 74 66 |. */.. | printf|
|00000230| 28 22 5c 6e 5c 6e 4c 61 | 72 67 65 73 74 20 76 61 |("\n\nLa|rgest va|
|00000240| 6c 75 65 20 3d 20 25 64 | 5c 6e 22 2c 20 6c 61 72 |lue = %d|\n", lar|
|00000250| 67 65 73 74 28 61 72 72 | 61 79 2c 20 4d 41 58 29 |gest(arr|ay, MAX)|
|00000260| 29 3b 0d 0a 0d 0a 20 20 | 20 20 72 65 74 75 72 6e |);.... | return|
|00000270| 20 30 3b 0d 0a 7d 0d 0a | 2f 2a 20 46 75 6e 63 74 | 0;..}..|/* Funct|
|00000280| 69 6f 6e 20 6c 61 72 67 | 65 73 74 28 29 20 72 65 |ion larg|est() re|
|00000290| 74 75 72 6e 73 20 74 68 | 65 20 6c 61 72 67 65 73 |turns th|e larges|
|000002a0| 74 20 76 61 6c 75 65 20 | 2a 2f 0d 0a 2f 2a 20 69 |t value |*/../* i|
|000002b0| 6e 20 61 6e 20 69 6e 74 | 65 67 65 72 20 61 72 72 |n an int|eger arr|
|000002c0| 61 79 20 2a 2f 0d 0a 0d | 0a 69 6e 74 20 6c 61 72 |ay */...|.int lar|
|000002d0| 67 65 73 74 28 69 6e 74 | 20 6e 75 6d 5f 61 72 72 |gest(int| num_arr|
|000002e0| 61 79 5b 5d 2c 20 69 6e | 74 20 6c 65 6e 67 74 68 |ay[], in|t length|
|000002f0| 29 0d 0a 7b 0d 0a 20 20 | 20 20 69 6e 74 20 63 6f |)..{.. | int co|
|00000300| 75 6e 74 2c 20 62 69 67 | 67 65 73 74 20 3d 20 2d |unt, big|gest = -|
|00000310| 31 32 30 30 30 3b 0d 0a | 0d 0a 20 20 20 20 66 6f |12000;..|.. fo|
|00000320| 72 20 28 20 63 6f 75 6e | 74 20 3d 20 30 3b 20 63 |r ( coun|t = 0; c|
|00000330| 6f 75 6e 74 20 3c 20 6c | 65 6e 67 74 68 3b 20 63 |ount < l|ength; c|
|00000340| 6f 75 6e 74 2b 2b 29 0d | 0a 20 20 20 20 7b 0d 0a |ount++).|. {..|
|00000350| 20 20 20 20 20 20 20 20 | 69 66 20 28 6e 75 6d 5f | |if (num_|
|00000360| 61 72 72 61 79 5b 63 6f | 75 6e 74 5d 20 3e 20 62 |array[co|unt] > b|
|00000370| 69 67 67 65 73 74 29 0d | 0a 20 20 20 20 20 20 20 |iggest).|. |
|00000380| 20 20 20 20 20 62 69 67 | 67 65 73 74 20 3d 20 6e | big|gest = n|
|00000390| 75 6d 5f 61 72 72 61 79 | 5b 63 6f 75 6e 74 5d 3b |um_array|[count];|
|000003a0| 0d 0a 20 20 20 20 7d 0d | 0a 0d 0a 20 20 20 20 72 |.. }.|... r|
|000003b0| 65 74 75 72 6e 20 62 69 | 67 67 65 73 74 3b 0d 0a |eturn bi|ggest;..|
|000003c0| 7d 0d 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000410| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|00000420| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|00000430| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|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 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000490| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000510| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 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 |........|........|
+--------+-------------------------+-------------------------+--------+--------+