home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day23 / rect.cpp < prev    next >
MacBinary  |  2002-05-24  |  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
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri May 24 23:16:54 2002, modified Fri May 24 23:16:54 2002, creator 'LMAN', type ASCII, 782 bytes "rect.cpp" , at 0x38e 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 08 72 65 63 74 2e 63 | 70 70 00 00 00 00 00 00 |..rect.c|pp......|
|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 00 00 00 00 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 03 0e 00 | 00 01 1e b9 14 b2 a6 b9 |........|........|
|00000060| 14 b2 a6 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 2f 54 00 00 |........|..../T..|
|00000080| 2f 2f 55 73 69 6e 67 20 | 64 65 66 61 75 6c 74 20 |//Using |default |
|00000090| 70 61 72 61 6d 65 74 65 | 72 73 0d 0a 23 69 6e 63 |paramete|rs..#inc|
|000000a0| 6c 75 64 65 20 3c 69 6f | 73 74 72 65 61 6d 2e 68 |lude <io|stream.h|
|000000b0| 3e 0d 0a 0d 0a 2f 2f 20 | 46 75 6e 63 74 69 6f 6e |>....// |Function|
|000000c0| 20 70 72 6f 74 6f 74 79 | 70 65 20 77 69 74 68 20 | prototy|pe with |
|000000d0| 64 65 66 61 75 6c 74 20 | 70 61 72 61 6d 65 74 65 |default |paramete|
|000000e0| 72 73 0d 0a 76 6f 69 64 | 20 72 65 63 74 61 6e 67 |rs..void| rectang|
|000000f0| 6c 65 20 28 69 6e 74 20 | 77 69 64 74 68 20 3d 20 |le (int |width = |
|00000100| 33 2c 20 69 6e 74 20 6c | 65 6e 67 74 68 20 3d 20 |3, int l|ength = |
|00000110| 33 2c 20 63 68 61 72 20 | 64 72 61 77 5f 63 68 61 |3, char |draw_cha|
|00000120| 72 20 3d 20 27 58 27 29 | 3b 0d 0a 0d 0a 69 6e 74 |r = 'X')|;....int|
|00000130| 20 6d 61 69 6e 28 69 6e | 74 20 61 72 67 63 2c 20 | main(in|t argc, |
|00000140| 63 68 61 72 2a 20 61 72 | 67 76 5b 5d 29 0d 0a 7b |char* ar|gv[])..{|
|00000150| 0d 0a 20 20 20 20 63 6f | 75 74 20 3c 3c 20 22 5c |.. co|ut << "\|
|00000160| 6e 72 65 63 74 61 6e 67 | 6c 65 28 20 38 2c 20 32 |nrectang|le( 8, 2|
|00000170| 2c 20 5c 27 2a 5c 27 20 | 29 3b 5c 6e 22 3b 0d 0a |, \'*\' |);\n";..|
|00000180| 20 20 20 20 72 65 63 74 | 61 6e 67 6c 65 28 20 38 | rect|angle( 8|
|00000190| 2c 20 32 2c 20 27 2a 27 | 20 29 3b 0d 0a 0d 0a 20 |, 2, '*'| );.... |
|000001a0| 20 20 20 63 6f 75 74 20 | 3c 3c 20 22 5c 6e 72 65 | cout |<< "\nre|
|000001b0| 63 74 61 6e 67 6c 65 28 | 20 34 2c 20 35 20 29 3b |ctangle(| 4, 5 );|
|000001c0| 5c 6e 22 3b 0d 0a 20 20 | 20 20 72 65 63 74 61 6e |\n";.. | rectan|
|000001d0| 67 6c 65 28 20 34 2c 20 | 35 20 29 3b 0d 0a 0d 0a |gle( 4, |5 );....|
|000001e0| 20 20 20 20 63 6f 75 74 | 20 3c 3c 20 22 5c 6e 72 | cout| << "\nr|
|000001f0| 65 63 74 61 6e 67 6c 65 | 28 20 32 20 29 3b 5c 6e |ectangle|( 2 );\n|
|00000200| 22 3b 0d 0a 20 20 20 20 | 72 65 63 74 61 6e 67 6c |";.. |rectangl|
|00000210| 65 28 20 32 20 29 3b 0d | 0a 0d 0a 20 20 20 20 63 |e( 2 );.|... c|
|00000220| 6f 75 74 20 3c 3c 20 22 | 5c 6e 72 65 63 74 61 6e |out << "|\nrectan|
|00000230| 67 6c 65 28 20 29 3b 5c | 6e 22 3b 0d 0a 20 20 20 |gle( );\|n";.. |
|00000240| 20 72 65 63 74 61 6e 67 | 6c 65 28 20 29 3b 0d 0a | rectang|le( );..|
|00000250| 0d 0a 20 20 20 20 72 65 | 74 75 72 6e 20 30 3b 0d |.. re|turn 0;.|
|00000260| 0a 7d 0d 0a 0d 0a 76 6f | 69 64 20 72 65 63 74 61 |.}....vo|id recta|
|00000270| 6e 67 6c 65 20 28 20 69 | 6e 74 20 77 69 64 74 68 |ngle ( i|nt width|
|00000280| 2c 20 69 6e 74 20 6c 65 | 6e 67 74 68 2c 20 63 68 |, int le|ngth, ch|
|00000290| 61 72 20 64 72 61 77 5f | 63 68 61 72 20 29 0d 0a |ar draw_|char )..|
|000002a0| 7b 0d 0a 20 20 20 69 6e | 74 20 63 74 72 31 20 3d |{.. in|t ctr1 =|
|000002b0| 20 30 3b 0d 0a 20 20 20 | 69 6e 74 20 63 74 72 32 | 0;.. |int ctr2|
|000002c0| 20 3d 20 30 3b 0d 0a 0d | 0a 20 20 20 66 6f 72 20 | = 0;...|. for |
|000002d0| 28 63 74 72 31 20 3d 20 | 30 3b 20 63 74 72 31 20 |(ctr1 = |0; ctr1 |
|000002e0| 3c 20 6c 65 6e 67 74 68 | 3b 20 63 74 72 31 2b 2b |< length|; ctr1++|
|000002f0| 20 29 0d 0a 20 20 20 7b | 0d 0a 20 20 20 20 20 20 | ).. {|.. |
|00000300| 20 63 6f 75 74 20 3c 3c | 20 22 5c 6e 22 3b 0d 0a | cout <<| "\n";..|
|00000310| 20 20 20 20 20 20 20 66 | 6f 72 20 28 20 63 74 72 | f|or ( ctr|
|00000320| 32 20 3d 20 30 3b 20 63 | 74 72 32 20 3c 20 77 69 |2 = 0; c|tr2 < wi|
|00000330| 64 74 68 3b 20 63 74 72 | 32 2b 2b 29 0d 0a 20 20 |dth; ctr|2++).. |
|00000340| 20 20 20 20 20 7b 0d 0a | 20 20 20 20 20 20 20 20 | {..| |
|00000350| 20 20 20 63 6f 75 74 20 | 3c 3c 20 64 72 61 77 5f | cout |<< draw_|
|00000360| 63 68 61 72 3b 0d 0a 20 | 20 20 20 20 20 20 7d 0d |char;.. | }.|
|00000370| 0a 20 20 20 7d 0d 0a 20 | 20 20 63 6f 75 74 20 3c |. }.. | cout <|
|00000380| 3c 20 22 5c 6e 22 3b 0d | 0a 7d 0d 0a 0d 0a 00 00 |< "\n";.|.}......|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 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 |........|........|
+--------+-------------------------+-------------------------+--------+--------+