home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day08 / test.c < prev    next >
MacBinary  |  2002-06-09  |  1.3 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
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Jun 9 12:27:32 2002, modified Sun Jun 9 12:27:32 2002, creator 'LMAN', type ASCII, 762 bytes "test.c" , at 0x37a 286 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% 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 06 74 65 73 74 2e 63 | 00 00 00 00 00 00 00 00 |..test.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 02 fa 00 | 00 01 1e b9 29 32 74 b9 |........|....)2t.|
|00000060| 29 32 74 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |)2t.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ac 59 00 00 |........|.....Y..|
|00000080| 2f 2a 20 72 61 6e 64 6f | 6d 2e 63 20 2d 20 44 65 |/* rando|m.c - De|
|00000090| 6d 6f 6e 73 74 72 61 74 | 65 73 20 75 73 69 6e 67 |monstrat|es using|
|000000a0| 20 61 20 6d 75 6c 74 69 | 64 69 6d 65 6e 73 69 6f | a multi|dimensio|
|000000b0| 6e 61 6c 20 61 72 72 61 | 79 20 2a 2f 0d 0a 0d 0a |nal arra|y */....|
|000000c0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|000000d0| 68 3e 0d 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |h>..#inc|lude <st|
|000000e0| 64 6c 69 62 2e 68 3e 0d | 0a 2f 2a 20 44 65 63 6c |dlib.h>.|./* Decl|
|000000f0| 61 72 65 20 61 20 74 68 | 72 65 65 2d 64 69 6d 65 |are a th|ree-dime|
|00000100| 6e 73 69 6f 6e 61 6c 20 | 61 72 72 61 79 20 77 69 |nsional |array wi|
|00000110| 74 68 20 31 30 30 30 20 | 65 6c 65 6d 65 6e 74 73 |th 1000 |elements|
|00000120| 20 2a 2f 0d 0a 0d 0a 69 | 6e 74 20 72 61 6e 64 6f | */....i|nt rando|
|00000130| 6d 5f 61 72 72 61 79 5b | 36 34 30 30 30 5d 5b 31 |m_array[|64000][1|
|00000140| 30 5d 3b 0d 0a 69 6e 74 | 20 61 2c 20 62 2c 20 63 |0];..int| a, b, c|
|00000150| 3b 0d 0a 0d 0a 69 6e 74 | 20 6d 61 69 6e 28 20 76 |;....int| main( v|
|00000160| 6f 69 64 20 29 0d 0a 7b | 0d 0a 20 20 20 20 2f 2a |oid )..{|.. /*|
|00000170| 20 46 69 6c 6c 20 74 68 | 65 20 61 72 72 61 79 20 | Fill th|e array |
|00000180| 77 69 74 68 20 72 61 6e | 64 6f 6d 20 6e 75 6d 62 |with ran|dom numb|
|00000190| 65 72 73 2e 20 54 68 65 | 20 43 20 6c 69 62 72 61 |ers. The| C libra|
|000001a0| 72 79 20 2a 2f 0d 0a 20 | 20 20 20 2f 2a 20 66 75 |ry */.. | /* fu|
|000001b0| 6e 63 74 69 6f 6e 20 72 | 61 6e 64 28 29 20 72 65 |nction r|and() re|
|000001c0| 74 75 72 6e 73 20 61 20 | 72 61 6e 64 6f 6d 20 6e |turns a |random n|
|000001d0| 75 6d 62 65 72 2e 20 55 | 73 65 20 6f 6e 65 20 2a |umber. U|se one *|
|000001e0| 2f 0d 0a 20 20 20 20 2f | 2a 20 66 6f 72 20 6c 6f |/.. /|* for lo|
|000001f0| 6f 70 20 66 6f 72 20 65 | 61 63 68 20 61 72 72 61 |op for e|ach arra|
|00000200| 79 20 73 75 62 73 63 72 | 69 70 74 2e 20 2a 2f 0d |y subscr|ipt. */.|
|00000210| 0a 0d 0a 20 20 20 20 70 | 72 69 6e 74 66 28 22 69 |... p|rintf("i|
|00000220| 6e 74 20 25 64 22 2c 20 | 73 69 7a 65 6f 66 28 69 |nt %d", |sizeof(i|
|00000230| 6e 74 29 29 3b 0d 0a 20 | 20 20 20 70 72 69 6e 74 |nt));.. | print|
|00000240| 66 28 22 73 68 6f 72 74 | 20 25 64 22 2c 20 73 69 |f("short| %d", si|
|00000250| 7a 65 6f 66 28 73 68 6f | 72 74 29 29 3b 0d 0a 20 |zeof(sho|rt));.. |
|00000260| 20 20 20 70 72 69 6e 74 | 66 28 22 6c 6f 6e 67 20 | print|f("long |
|00000270| 25 64 22 2c 20 73 69 7a | 65 6f 66 28 6c 6f 6e 67 |%d", siz|eof(long|
|00000280| 29 29 3b 0d 0a 20 20 20 | 20 70 72 69 6e 74 66 28 |));.. | printf(|
|00000290| 22 6c 6f 6e 67 20 6c 6f | 6e 67 20 25 64 22 2c 20 |"long lo|ng %d", |
|000002a0| 73 69 7a 65 6f 66 28 6c | 6f 6e 67 20 6c 6f 6e 67 |sizeof(l|ong long|
|000002b0| 29 29 3b 0d 0a 20 20 20 | 20 70 72 69 6e 74 66 28 |));.. | printf(|
|000002c0| 22 66 6c 6f 61 74 20 25 | 64 22 2c 20 73 69 7a 65 |"float %|d", size|
|000002d0| 6f 66 28 66 6c 6f 61 74 | 29 29 3b 0d 0a 20 20 20 |of(float|));.. |
|000002e0| 20 70 72 69 6e 74 66 28 | 22 64 6f 75 62 6c 65 20 | printf(|"double |
|000002f0| 25 64 22 2c 20 73 69 7a | 65 6f 66 28 64 6f 75 62 |%d", siz|eof(doub|
|00000300| 6c 65 29 29 3b 0d 0a 0d | 0a 20 20 20 20 2f 2a 20 |le));...|. /* |
|00000310| 4e 6f 77 20 64 69 73 70 | 6c 61 79 20 74 68 65 20 |Now disp|lay the |
|00000320| 61 72 72 61 79 20 65 6c | 65 6d 65 6e 74 73 20 31 |array el|ements 1|
|00000330| 30 20 61 74 20 61 20 74 | 69 6d 65 20 2a 2f 0d 0a |0 at a t|ime */..|
|00000340| 0d 0a 20 20 20 20 67 65 | 74 63 68 28 29 3b 0d 0a |.. ge|tch();..|
|00000350| 20 20 20 20 72 65 74 75 | 72 6e 20 30 3b 0d 0a 7d | retu|rn 0;..}|
|00000360| 20 20 20 2f 2a 20 65 6e | 64 20 6f 66 20 6d 61 69 | /* en|d of mai|
|00000370| 6e 28 29 20 2a 2f 0d 0a | 0d 0a 00 00 00 00 00 00 |n() */..|........|
|00000380| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000390| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|000003a0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|000003b0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|000003c0| 00 00 00 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 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 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 |........|........|
+--------+-------------------------+-------------------------+--------+--------+