home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day23 / inline.cpp < prev    next >
MacBinary  |  2002-05-24  |  1.0 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:27:28 2002, modified Fri May 24 23:27:28 2002, creator 'LMAN', type ASCII, 501 bytes "inline.cpp" , at 0x275 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 69 6e 6c 69 6e 65 | 2e 63 70 70 00 00 00 00 |..inline|.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 01 f5 00 | 00 01 1e b9 14 b5 20 b9 |........|...... .|
|00000060| 14 b5 20 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 f6 08 00 00 |........|........|
|00000080| 2f 2f 55 73 69 6e 67 20 | 69 6e 6c 69 6e 65 20 66 |//Using |inline f|
|00000090| 75 6e 63 74 69 6f 6e 73 | 0d 0a 23 69 6e 63 6c 75 |unctions|..#inclu|
|000000a0| 64 65 20 3c 69 6f 73 74 | 72 65 61 6d 2e 68 3e 0d |de <iost|ream.h>.|
|000000b0| 0a 0d 0a 69 6e 6c 69 6e | 65 20 6c 6f 6e 67 20 73 |...inlin|e long s|
|000000c0| 71 75 61 72 65 28 20 6c | 6f 6e 67 20 76 61 6c 75 |quare( l|ong valu|
|000000d0| 65 20 29 0d 0a 7b 0d 0a | 20 20 20 20 72 65 74 75 |e )..{..| retu|
|000000e0| 72 6e 20 28 76 61 6c 75 | 65 20 2a 20 76 61 6c 75 |rn (valu|e * valu|
|000000f0| 65 20 29 3b 0d 0a 7d 0d | 0a 0d 0a 69 6e 6c 69 6e |e );..}.|...inlin|
|00000100| 65 20 6c 6f 6e 67 20 68 | 61 6c 76 65 28 20 6c 6f |e long h|alve( lo|
|00000110| 6e 67 20 76 61 6c 75 65 | 20 29 0d 0a 7b 0d 0a 20 |ng value| )..{.. |
|00000120| 20 20 20 72 65 74 75 72 | 6e 20 28 76 61 6c 75 65 | retur|n (value|
|00000130| 20 2f 20 32 29 3b 0d 0a | 7d 0d 0a 0d 0a 69 6e 74 | / 2);..|}....int|
|00000140| 20 6d 61 69 6e 28 69 6e | 74 20 61 72 67 63 2c 20 | main(in|t argc, |
|00000150| 63 68 61 72 2a 20 61 72 | 67 76 5b 5d 29 0d 0a 7b |char* ar|gv[])..{|
|00000160| 0d 0a 20 20 20 20 6c 6f | 6e 67 20 6e 62 72 3b 0d |.. lo|ng nbr;.|
|00000170| 0a 0d 0a 20 20 20 20 63 | 6f 75 74 20 3c 3c 22 5c |... c|out <<"\|
|00000180| 6e 45 6e 74 65 72 20 61 | 20 6e 75 6d 62 65 72 3a |nEnter a| number:|
|00000190| 20 22 3b 0d 0a 20 20 20 | 20 63 69 6e 20 3e 3e 20 | ";.. | cin >> |
|000001a0| 6e 62 72 3b 0d 0a 0d 0a | 20 20 20 20 63 6f 75 74 |nbr;....| cout|
|000001b0| 20 3c 3c 22 5c 6e 5c 6e | 53 71 75 61 72 65 64 3a | <<"\n\n|Squared:|
|000001c0| 20 22 20 3c 3c 20 73 71 | 75 61 72 65 28 6e 62 72 | " << sq|uare(nbr|
|000001d0| 29 3b 0d 0a 20 20 20 20 | 63 6f 75 74 20 3c 3c 22 |);.. |cout <<"|
|000001e0| 5c 6e 48 61 6c 76 65 64 | 3a 20 22 20 20 3c 3c 20 |\nHalved|: " << |
|000001f0| 68 61 6c 76 65 28 6e 62 | 72 29 3b 0d 0a 0d 0a 20 |halve(nb|r);.... |
|00000200| 20 20 20 63 6f 75 74 20 | 3c 3c 22 5c 6e 48 61 6c | cout |<<"\nHal|
|00000210| 66 20 74 68 65 20 73 71 | 75 61 72 65 3a 20 22 3b |f the sq|uare: ";|
|00000220| 0d 0a 20 20 20 20 63 6f | 75 74 20 3c 3c 20 68 61 |.. co|ut << ha|
|00000230| 6c 76 65 28 73 71 75 61 | 72 65 28 6e 62 72 29 29 |lve(squa|re(nbr))|
|00000240| 3b 0d 0a 0d 0a 20 20 20 | 20 63 6f 75 74 20 3c 3c |;.... | cout <<|
|00000250| 20 22 5c 6e 5c 6e 44 6f | 6e 65 21 22 3b 0d 0a 0d | "\n\nDo|ne!";...|
|00000260| 0a 20 20 20 20 72 65 74 | 75 72 6e 20 30 3b 0d 0a |. ret|urn 0;..|
|00000270| 7d 0d 0a 0d 0a 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|00000280| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000290| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|000002a0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|000002b0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 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 |........|........|
+--------+-------------------------+-------------------------+--------+--------+