Re: Re to vectors: [Dev-C++] sizeof array
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Carlos d. M. <cg...@wo...> - 2002-08-01 11:07:38
|
Answers inline. Ioannis Vranos escribi=F3: > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Carlos Garc?a del Monte > > Sent: Wednesday, July 31, 2002 9:51 PM > > To: dev-cpp-users-list > > Subject: Re to vectors: [Dev-C++] sizeof array > > > > > > > > vectors, of course, but I understood vectors weren't an > > option, that Mr > > Ramana wants arrays. > > But I don't like them very much, I'll need something that you > > would say > > "vectors!", but I tried them in a elevator simulation, and I got > > problems with STL, if I used vector (or list, now I don't > > remember when > > it was vector and when list) I had a problem, I tried to do > > it with list > > but then the list couldn't do one pass at it should be done. > > No insult intended, but 100% the problem was that you did not know how > to use them and not the vector itself. I don't see any insult. Of course this is a possibility I don't reject, b= ut if the code was wrogn I couldn't see any error (at lest clearly visible), and a coulpe of times in tiny experiments without possible error passing = my own objects, having included everything, I got that the object was not declared, or somethign similar, not declared vector<object, iterator> (th= is is not an exact cite, I don't remember exactly how was the message), and = it didn't accept a correct declaration of an iterator, (code just equal to t= he book, and which worked with other kinds of data). Sure I would make what I want with vectors, but I believe making my own containers will be easier than correct my use of them. However, I think t= hat there was a problem of one feature (I've forget what) that needed a capability of vectors, but another which has lists (or was at inverse). Perhaps there was no error in vectors or lists and the errors which sem related to them were consequence of another pair of strange errors: funct= ion called where no call was in the code, and calls to functions in other pla= ces where it was called. Perhaps a bad use of my objects with the vector, not with the vector itself. For example, people were objects of the vector, o= ne man enters, a man is created and added to the vector, when he does what h= ave to do, the vector's iterator goes to the next man, or starts the next cyc= le through men in the building, right, but when they pushed the elevator button, the destructor was called, and debugging I didn't see the program passing through a call to it!!! > > > > So now I am > > writing my own container library, since what I need is > > something rather > > complicated, and if for that I got problems, for which I > > need... woooo!. > > This is a radical step. Better learn what the standard library has to > offer you and then try to make your stuff. :) The standard library is > very wise, very generic and very high level. What I said is something about me, that I say perhaps is the case of othe= rs (or not). But for everyone who is reading this I must add that, naturally= , I don't recommend my solution if you are not completely decided to it, I of course recommend the yours: Learn to use STL!!!! > > > > Well, I haven't tested the mine in that simulation (now I've > > forget its > > details), but tests with another program work fine. So I say > > goodbye to > > STL, vector, list and so, and I'll make my own container > > classes, I hope > > much more powerful than STL. Out limits! > > You may be an excellent coder and write an excellent container, but i > strongly suspect that there is no need for that. > > > My classes have (or will have sooner or later) all capabilities of ST= L > > and more. > > :) > > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.cjb.net > * Alternative URL: http://run.to/noicys > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |