Article View: csu.cs.200
Article #122Extend_STK()
From: Adam Carheden
Date: Wed, 21 Oct 1998 00:00
Date: Wed, 21 Oct 1998 00:00
17 lines
1237 bytes
1237 bytes
I can't get my Stack.h ADT to compile. The problem is in the Extend_STK function that uses both the copy constructor and assignment operator (=) with &this as the argument. The compiler gives the error non-lvalue. I used the copy constructor to make a new stack of greater size and the assignment operator to set the old stack (this) to the new stack. Yes, I've tried compiling without this (as opposed to &this), but then I get a type error. The copy constructor and assignment operator both take Stack<...>& as arguments as shown in class. I think I'm totally on the wrong track with the whole Extend_STK function. Any hints (not code of course, rules are rules) would be appreciated. TIA -- Adam carheden@holly.colostate.edu
Technical Details
Message-ID:
<362EC559.7273D88A@holly.colostate.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 127144,6c45165c401d3feb,start X-Google-Attributes: gid127144,public From: Adam Carheden <carheden@holly.colostate.edu> Subject: Extend_STK() Date: 1998/10/21 Message-ID: <362EC559.7273D88A@holly.colostate.edu> X-Deja-AN: 403819893 Content-Transfer-Encoding: 7bit Organization: Colorado State University, Fort Collins, CO 80523 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: csu.cs.200