/ Sams Teach Yourself C in 21 Days (6th Edition)
/ STYC216E.ISO / mac / Examples / Day24 / order.cpp ![]() | < prev | next > |
MacBinary | 2002-05-25 | 1.5 KB | [TEXT/LMAN] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, Sat May 25 13:24:48 2002, modified Sat May 25 13:24:48 2002, creator 'LMAN', type ASCII, 1014 bytes "order.cpp" , at 0x476 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 | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [LMAN] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 6f 72 64 65 72 2e | 63 70 70 00 00 00 00 00 |..order.|cpp.....|
|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 f6 00 | 00 01 1e b9 15 79 60 b9 |........|.....y`.|
|00000060| 15 79 60 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.y`.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 44 97 00 00 |........|....D...|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 3c 69 6f 73 74 72 65 |#include| <iostre|
|00000090| 61 6d 2e 68 3e 0d 0a 0d | 0a 63 6c 61 73 73 20 62 |am.h>...|.class b|
|000000a0| 61 73 65 20 7b 0d 0a 70 | 72 6f 74 65 63 74 65 64 |ase {..p|rotected|
|000000b0| 3a 0d 0a 20 20 20 20 69 | 6e 74 20 20 42 76 61 6c |:.. i|nt Bval|
|000000c0| 3b 0d 0a 70 75 62 6c 69 | 63 3a 0d 0a 20 20 20 20 |;..publi|c:.. |
|000000d0| 76 6f 69 64 20 73 65 74 | 5f 42 76 61 6c 28 69 6e |void set|_Bval(in|
|000000e0| 74 20 78 29 20 7b 20 42 | 76 61 6c 20 3d 20 78 3b |t x) { B|val = x;|
|000000f0| 20 7d 3b 0d 0a 20 20 20 | 20 69 6e 74 20 20 67 65 | };.. | int ge|
|00000100| 74 5f 42 76 61 6c 28 69 | 6e 74 20 78 29 20 7b 20 |t_Bval(i|nt x) { |
|00000110| 72 65 74 75 72 6e 20 42 | 76 61 6c 3b 20 7d 3b 0d |return B|val; };.|
|00000120| 0a 20 20 20 20 62 61 73 | 65 28 20 69 6e 74 20 78 |. bas|e( int x|
|00000130| 20 3d 20 2d 39 39 20 29 | 3b 0d 0a 20 20 20 20 7e | = -99 )|;.. ~|
|00000140| 62 61 73 65 28 29 3b 20 | 20 20 20 20 20 20 20 20 |base(); | |
|00000150| 20 20 20 2f 2f 64 65 73 | 74 72 75 74 6f 72 0d 0a | //des|trutor..|
|00000160| 7d 3b 0d 0a 0d 0a 63 6c | 61 73 73 20 73 75 62 20 |};....cl|ass sub |
|00000170| 3a 20 70 75 62 6c 69 63 | 20 62 61 73 65 20 7b 0d |: public| base {.|
|00000180| 0a 70 72 6f 74 65 63 74 | 65 64 3a 0d 0a 20 20 20 |.protect|ed:.. |
|00000190| 20 69 6e 74 20 53 76 61 | 6c 3b 0d 0a 70 75 62 6c | int Sva|l;..publ|
|000001a0| 69 63 3a 0d 0a 20 20 20 | 76 6f 69 64 20 73 65 74 |ic:.. |void set|
|000001b0| 5f 53 76 61 6c 28 20 69 | 6e 74 20 78 20 29 20 7b |_Sval( i|nt x ) {|
|000001c0| 20 53 76 61 6c 20 3d 20 | 78 3b 20 7d 3b 0d 0a 20 | Sval = |x; };.. |
|000001d0| 20 20 20 69 6e 74 20 20 | 67 65 74 5f 53 76 61 6c | int |get_Sval|
|000001e0| 28 29 20 7b 20 72 65 74 | 75 72 6e 20 53 76 61 6c |() { ret|urn Sval|
|000001f0| 3b 20 7d 3b 0d 0a 20 20 | 20 20 73 75 62 28 20 69 |; };.. | sub( i|
|00000200| 6e 74 20 78 20 3d 20 2d | 32 32 20 29 3b 0d 0a 20 |nt x = -|22 );.. |
|00000210| 20 20 20 7e 73 75 62 28 | 29 3b 20 20 20 20 20 20 | ~sub(|); |
|00000220| 20 20 20 20 20 20 20 2f | 2f 20 64 65 73 74 72 75 | /|/ destru|
|00000230| 63 74 6f 72 0d 0a 7d 3b | 0d 0a 0d 0a 62 61 73 65 |ctor..};|....base|
|00000240| 3a 3a 62 61 73 65 28 20 | 69 6e 74 20 78 20 29 0d |::base( |int x ).|
|00000250| 0a 7b 0d 0a 20 20 20 20 | 42 76 61 6c 20 3d 20 78 |.{.. |Bval = x|
|00000260| 3b 0d 0a 20 20 20 20 63 | 6f 75 74 20 3c 3c 20 22 |;.. c|out << "|
|00000270| 5c 6e 20 42 20 3e 3e 20 | 69 6e 20 62 61 73 65 20 |\n B >> |in base |
|00000280| 63 6c 61 73 73 20 63 6f | 6e 73 74 72 75 63 74 6f |class co|nstructo|
|00000290| 72 2e 2e 2e 22 3b 0d 0a | 7d 0d 0a 0d 0a 62 61 73 |r...";..|}....bas|
|000002a0| 65 3a 3a 7e 62 61 73 65 | 28 29 0d 0a 7b 0d 0a 20 |e::~base|()..{.. |
|000002b0| 20 20 20 63 6f 75 74 20 | 3c 3c 20 22 5c 6e 20 42 | cout |<< "\n B|
|000002c0| 20 3e 3e 20 2e 2e 2e 69 | 6e 20 62 61 73 65 20 63 | >> ...i|n base c|
|000002d0| 6c 61 73 73 20 64 65 73 | 74 72 75 63 74 6f 72 22 |lass des|tructor"|
|000002e0| 3b 0d 0a 7d 0d 0a 0d 0a | 73 75 62 3a 3a 73 75 62 |;..}....|sub::sub|
|000002f0| 28 20 69 6e 74 20 78 20 | 29 20 3a 20 62 61 73 65 |( int x |) : base|
|00000300| 20 28 20 2d 31 20 29 0d | 0a 7b 0d 0a 20 20 20 20 | ( -1 ).|.{.. |
|00000310| 63 6f 75 74 20 3c 3c 20 | 22 5c 6e 20 53 20 3e 3e |cout << |"\n S >>|
|00000320| 20 69 6e 20 73 75 62 20 | 63 6c 61 73 73 20 63 6f | in sub |class co|
|00000330| 6e 73 74 72 75 63 74 6f | 72 2e 2e 2e 22 3b 0d 0a |nstructo|r...";..|
|00000340| 7d 0d 0a 0d 0a 73 75 62 | 3a 3a 7e 73 75 62 28 29 |}....sub|::~sub()|
|00000350| 0d 0a 7b 0d 0a 20 20 20 | 20 63 6f 75 74 20 3c 3c |..{.. | cout <<|
|00000360| 20 22 5c 6e 20 53 20 3e | 3e 20 2e 2e 2e 69 6e 20 | "\n S >|> ...in |
|00000370| 73 75 62 20 63 6c 61 73 | 73 20 64 65 73 74 72 75 |sub clas|s destru|
|00000380| 63 74 6f 72 22 3b 0d 0a | 7d 0d 0a 0d 0a 69 6e 74 |ctor";..|}....int|
|00000390| 20 6d 61 69 6e 28 69 6e | 74 20 61 72 67 63 2c 20 | main(in|t argc, |
|000003a0| 63 68 61 72 2a 20 61 72 | 67 76 5b 5d 29 0d 0a 7b |char* ar|gv[])..{|
|000003b0| 0d 0a 20 20 20 20 63 6f | 75 74 20 3c 3c 20 22 5c |.. co|ut << "\|
|000003c0| 6e 20 2e 20 3e 3e 20 49 | 6e 73 74 61 6e 74 69 61 |n . >> I|nstantia|
|000003d0| 74 69 6e 67 20 61 20 73 | 75 62 20 63 6c 61 73 73 |ting a s|ub class|
|000003e0| 2e 2e 2e 5c 6e 22 3b 0d | 0a 0d 0a 20 20 20 20 73 |...\n";.|... s|
|000003f0| 75 62 20 73 75 62 31 3b | 0d 0a 0d 0a 20 20 20 20 |ub sub1;|.... |
|00000400| 63 6f 75 74 20 3c 3c 20 | 22 5c 6e 20 2e 20 3e 3e |cout << |"\n . >>|
|00000410| 20 2e 2e 2e 73 75 62 20 | 63 6c 61 73 73 20 69 6e | ...sub |class in|
|00000420| 73 74 61 6e 74 69 61 74 | 65 64 2e 2e 2e 22 3b 0d |stantiat|ed...";.|
|00000430| 0a 20 20 20 20 63 6f 75 | 74 20 3c 3c 20 22 5c 6e |. cou|t << "\n|
|00000440| 20 2e 20 3e 3e 20 2e 2e | 2e 65 6e 64 69 6e 67 20 | . >> ..|.ending |
|00000450| 70 72 6f 67 72 61 6d 2e | 2e 2e 5c 6e 22 3b 0d 0a |program.|..\n";..|
|00000460| 0d 0a 20 20 20 20 72 65 | 74 75 72 6e 20 30 3b 0d |.. re|turn 0;.|
|00000470| 0a 7d 0d 0a 0d 0a 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 |........|........|
+--------+-------------------------+-------------------------+--------+--------+