#!/bin/sh # This is a shar archive. # The rest of this file is a shell script which will extract: # # 2_3.c 2_3a1.c 2_3a2.c 2_3a3.c 2_3b1.c 2_3b2.c 2_3b3.c 2_3b4.c 2_3c1.c 2_3c2.c 2_3c3.c 2_3c4.c 2_3c5.c 2_3d1.c 2_3d2.c 2_3d3.c 2_3d4.c 2_3d5.c 2_3e1.c 2_3e2.c 2_3e3.c 2_3e4.c 2_3e5.c 2_3f1.c 2_3f2.c 2_3f3.c 2_3f4.c 2_3g1.c 2_3h1.c 2_3h2.c 2_3h3.c 2_3i1.c 2_3i2.c 2_3i3.c makefile # # To extract the files from this shell archive file simply # create a directory for this file, move the archive file # to it and enter the command # # sh filename # # The files will be extracted automatically. # Note: Do not use csh. # # Archive created: Mon Jul 30 22:56:09 EDT 1990 # echo x - 2_3.c sed 's/^X//' > 2_3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ pointer to a character char *p = ""; vector of 10 integers int iv[10] = { 0 }; reference to vector of 10 integers int &riv[10] = iv; char *cv[] = { "a", "b", "c", 0 }; pointer to vector of char strings char *pcv[] = cv; pointer to pointer to char char **p = &cv[0]; constant integer const int maxint = 32767; pointer to constant integer const int *pci = &maxint; int i = 10; constant pointer to integer int *const cpi = &i; !EOF! ls -l 2_3.c echo x - 2_3a1.c sed 's/^X//' > 2_3a1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ *pc !EOF! ls -l 2_3a1.c echo x - 2_3a2.c sed 's/^X//' > 2_3a2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char *pc !EOF! ls -l 2_3a2.c echo x - 2_3a3.c sed 's/^X//' > 2_3a3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char c; // character char *pc = &c; // pointer to a character !EOF! ls -l 2_3a3.c echo x - 2_3b1.c sed 's/^X//' > 2_3b1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ iv[] !EOF! ls -l 2_3b1.c echo x - 2_3b2.c sed 's/^X//' > 2_3b2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ iv[10] !EOF! ls -l 2_3b2.c echo x - 2_3b3.c sed 's/^X//' > 2_3b3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ int iv[10] !EOF! ls -l 2_3b3.c echo x - 2_3b4.c sed 's/^X//' > 2_3b4.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // vector of 10 int int iv[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; !EOF! ls -l 2_3b4.c echo x - 2_3c1.c sed 's/^X//' > 2_3c1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ &riv !EOF! ls -l 2_3c1.c echo x - 2_3c2.c sed 's/^X//' > 2_3c2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ &riv[] !EOF! ls -l 2_3c2.c echo x - 2_3c3.c sed 's/^X//' > 2_3c3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ &riv[10] !EOF! ls -l 2_3c3.c echo x - 2_3c4.c sed 's/^X//' > 2_3c4.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ int &riv[10] !EOF! ls -l 2_3c4.c echo x - 2_3c5.c sed 's/^X//' > 2_3c5.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ int &riv[10] = iv; // reference to vector of 10 ints !EOF! ls -l 2_3c5.c echo x - 2_3d1.c sed 's/^X//' > 2_3d1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ *psv !EOF! ls -l 2_3d1.c echo x - 2_3d2.c sed 's/^X//' > 2_3d2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ (*psv)[] !EOF! ls -l 2_3d2.c echo x - 2_3d3.c sed 's/^X//' > 2_3d3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ (*psv)[4] !EOF! ls -l 2_3d3.c echo x - 2_3d4.c sed 's/^X//' > 2_3d4.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char *(*psv)[4] !EOF! ls -l 2_3d4.c echo x - 2_3d5.c sed 's/^X//' > 2_3d5.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char *cv[4] = // vector of 4 strings { "aw", "bx", "cy", "dz" }; char *(*psv)[4] = &cv; // ptr to vector of 4 strings !EOF! ls -l 2_3d5.c echo x - 2_3e1.c sed 's/^X//' > 2_3e1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ *psv !EOF! ls -l 2_3e1.c echo x - 2_3e2.c sed 's/^X//' > 2_3e2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ **psv !EOF! ls -l 2_3e2.c echo x - 2_3e3.c sed 's/^X//' > 2_3e3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char ***psv !EOF! ls -l 2_3e3.c echo x - 2_3e4.c sed 's/^X//' > 2_3e4.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char **ps = new char*[4]; char ***psv = &ps; // ptr to vector of strings !EOF! ls -l 2_3e4.c echo x - 2_3e5.c sed 's/^X//' > 2_3e5.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ ps[0] = "aw"; ps[1] = "bx"; ps[2] = "cy"; ps[3] = "dz"; !EOF! ls -l 2_3e5.c echo x - 2_3f1.c sed 's/^X//' > 2_3f1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ *ppc !EOF! ls -l 2_3f1.c echo x - 2_3f2.c sed 's/^X//' > 2_3f2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ **ppc !EOF! ls -l 2_3f2.c echo x - 2_3f3.c sed 's/^X//' > 2_3f3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char **ppc; !EOF! ls -l 2_3f3.c echo x - 2_3f4.c sed 's/^X//' > 2_3f4.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ char *pc; // ptr to char char **ppc = &pc; // ptr to ptr to char !EOF! ls -l 2_3f4.c echo x - 2_3g1.c sed 's/^X//' > 2_3g1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ const int maxint = 32767; // constant integer !EOF! ls -l 2_3g1.c echo x - 2_3h1.c sed 's/^X//' > 2_3h1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ *pci !EOF! ls -l 2_3h1.c echo x - 2_3h2.c sed 's/^X//' > 2_3h2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ const int *pci !EOF! ls -l 2_3h2.c echo x - 2_3h3.c sed 's/^X//' > 2_3h3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ const int *pci = &maxint; // pointer to constant int !EOF! ls -l 2_3h3.c echo x - 2_3i1.c sed 's/^X//' > 2_3i1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ *const cpi !EOF! ls -l 2_3i1.c echo x - 2_3i2.c sed 's/^X//' > 2_3i2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ int *const cpi !EOF! ls -l 2_3i2.c echo x - 2_3i3.c sed 's/^X//' > 2_3i3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ int i = 10; // int int *const cpi = &i; // constant pointer to int !EOF! ls -l 2_3i3.c echo x - makefile sed 's/^X//' > makefile << '!EOF!' test: @echo tests done !EOF! ls -l makefile # The following exit is to ensure that extra garbage # after the end of the shar file will be ignored. exit 0