delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/08/09:16:49

From: "mpt" <M DOT P DOT Tidball AT cs DOT cf DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: virtual problems
Date: Fri, 8 Jan 1999 14:06:37 -0000
Organization: uwcc
Lines: 66
Message-ID: <7753dg$ft3$1@loki.cf.ac.uk>
NNTP-Posting-Host: lab10.cs.cf.ac.uk
X-Newsreader: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Here is a test program I wrote and compiled (or tried to) using DJGPP.

It's just a trifle to test the effectiveness of the virtual mechanisms in
C++ (new boy, you see).

When I compiled it as it is, the linker reported several invalid references
to Thing functions, nodes and tables.

When I put some braces on the ends of the function definitions within the
Thing class, the linker was happy (why?).

However, even in this happy state, the program would:

a)    return a bizarre long integer from the first Thing in the vector,
b)    return the same string whichever Thing the second extraction
        used thingVec[ 0 ] or [ 1 ]), and
c)    not fire the Thing_a and Thing_b print functions.

Help!

Pardon the rude words in the code - as you might guess, this problem has
really rammed my rectum.

M

http://www.cs.cf.ac.uk/User/M.P.Tidball/index.html






begin 666 inher001.cpp
M(VEN8VQU9&4\:6]S=')E86T^#0HC:6YC;'5D93QS=')I;F<^#0HC:6YC;'5D
M93QV96-T;W(^#0H-"F-L87-S(%1H:6YG#0I[#0H)<'5B;&EC DOT  AT T*"2 @( EV
M:7)T=6%L(&EN="!N=6UB97(H*3L-"B @(" @(" @"79I<G1U86P@<W1R:6YG
M('-T<B AT I DOT PT*"0EV:7)T=6%L('9O:60@<')I;G0H*3L-"GT[#0H-"F-L87-S
M(%1H:6YG7V$@.B!P=6)L:6,@5&AI;F<-"GL-"@EP=6)L:6,Z#0H)"51H:6YG
M7V$H(&EN="!N=6T@*2 Z#0H)"0E?;G5M8F5R*"!N=6T@*2![?3L-"B @(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E<F%T;W(@:71E<CL-"@T*"69O
M<B H:71E<B ]('1H:6YG5F5C+F)E9VEN*"D[(&ET97(@(3T@=&AI;F=696,N
M96YD*"D[(&ET97(K*RD-"B @( D):71E<BT^<')I;G0H*3L-"@T*"6EN="!N
M=6UB97(@/2!T:&EN9U9E8UL@,"!=+FYU;6)E<B AT I DOT PT*"7-T<FEN9R!S='(Q
M(#T@=&AI;F=696-;(#$@72YS='(H*3L-"@EC;W5T(#P\(&YU;6)E<B \/" B
M("(@/#P@<W1R,2 \/"!E;F1L.PT*(" @"6-O=70@/#P AT 96YD;#L-"@T*"7)E
-='5R;B@@," I.PT*?0``
`
end

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019