![]() |
| ||
| Stack with Dynamic Array Hi all... I tried to maked Stack with Dynamic Array but ........ class Stacksucced when main is empty #include "stdafx.h" when i tried to write in main ....... #include "stdafx.h"3_synatx error apper to me Error 1 error LNK2019: unresolved external symbol "public: __thiscall Stack::~Stack(void)" (??1Stack@@QAE@XZ) referenced in function _wmain Stack.obj Error 2 error LNK2019: unresolved external symbol "public: __thiscall Stack::Stack(void)" (??0Stack@@QAE@XZ) referenced in function _wmain Stack.obj Error 3 fatal error LNK1120: 2 unresolved externals E:\YOZOO\struct.prog\data structured\problems in c++\SecondYear\Stack\Debug\Stack.exe |
| ||
| Re: Stack with Dynamic Array You have not defined a few components. e.g. you need to add a destructor Stack::~Stack() { // stuff } etc. |
| ||
| Re: Stack with Dynamic Array but i defined it ... here Stack ::~Stack() { delete[]SS; } do you that or something else ??? |
| ||
| Re: Stack with Dynamic Array Sorry my mistake, I just read the error message and assumed. Ok so I copied and compiled the code. Here is what I had to fix. (a) Size in the constructor needs to be size. (b) Expand doesn't have an SS_2 variable and the last line should be SS=SS_2;(c) The guard in the assignment operator is mal formed it should be if (this!=&RHS) (d) In the same function, SS_2 should read SS. (e) Stack::Pushcapacity is actually size (f) That is it... Don't think the code works but it does compile.... time for you to test.... |
| All times are GMT -4. The time now is 10:23 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC