Hello all,
I'm trying to pin down the kind of container I need to select, and if there isn't one that works, to determine what I need to write my own that isn't too slow. Here are the requirements...
Type: Posts; User: Korhedron
Hello all,
I'm trying to pin down the kind of container I need to select, and if there isn't one that works, to determine what I need to write my own that isn't too slow. Here are the requirements...
Thanks for the help, Salem.
I've decided to use the following, though it's probably not optimal :
ifstream fin;
string myString;
istringstream mySStream;
list <double> myList; // List used...
Hello,
I'd like some advice on how to go about reading a data file efficiently - that is, with as little wasted operation as possible.
The files I'm trying to read are in this format :
#...
This is the last post I'll be making in this thread, because you're not worth arguing with. Did I suggest something that would solve his problem ? Yes. Did you ? No.
*Sighs*
I suggested a solution that would solve the OP's problems. I didn't tell him not to use Visual Studio. Actually, I used the words, "I suggest", while you, Elysia, told him he "should be...
I understand my error now - I wasn't differentiating between objects and their instances. Thanks very much for the help !
It should be able to access protected members of classes that it is derived from, not members on its same hierarchical level. So, it should have access to protected Paths objects, but not protected...
Hi anon,
Given LanguagePaths inherits Paths, surely it can access Paths' protected members ? That's the difference between private and protected. Am I wrong ?
Thanks,
Quentin
Some people will massacre me for saying this, but I've never gotten along with Visual Studio. I suggest ( and people will massacre me for this too ) you try Code::Blocks. It's free and I've never had...
How are you using it ? This works for me :
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
double x;
Hello,
I have a base class Paths, and a derived class LanguagePaths, which inherits Paths. There are various members of Paths, namely two doubles and a std::list <int>, which I'd like to copy from...
Thanks very much, that works - though I've removed const keywords because, as you've realised, I'm not comfortable with them. The main issue was the way I was passing the PathCompare object to the...
laserlight, CornedBee, thanks for the help. I think I'm almost there, but still getting an error. I can't find a way to fix it. Any ideas would be really welcome ! Thanks.
Comparison Class .h
...
Your first suggestion is great, but it would confuse other things, such as creating empty Paths which aren't linked to specific Graph objects yet. Some Path objects are temporary variables, which...
Thanks for the help, laserlight. That makes sense, though it's gotten a little more complicated now. The function .getLength(Graph &) actually takes an argument, which is itself another class ( you...
Hello,
I'm trying to implement a std::priority_queue, but the literature is quite fuzzy, and I don't understand some of the things I need to do.
I have a class called Paths, which contains, as...
tabstop - type is initialised in the constructor of the node, so I know exactly what's in there. In a Mortal, it's 2. In a Node, it's 0.
And yes, I place my pieces at 1,1, again in the...
Ah, I see where I went wrong there. I've now fixed that, but still get a segfault in the same place.
How so ? They're part of Node, and so, part of Mortal.
int type, that is taken as an argument under positions.presence, is part of an ENUM, and hence starts at zero, so there's no problem with it being invalid in the array.
Interesting.
error: cannot dynamic_cast `mortalslist.List::conductor' (of type `class Node*') to type `class Mortal*' (source type is not polymorphic)[/error]
Using a reinterpret_cast, I was...
Could you show me the syntax ? I've tried dynamic_cast on the line above, and couldn't get it to work. Namely,
if(mortalslist.dynamic_cast<Mortal*>(conductor)->death) mortalslist.remove();
...
Hello,
I'd like to thank everyone that helped me out last time when I was having class issues - I've taken your recommendations on board and rewritten my code. Here's an explanation of my problem...
Mats, thanks again. Though, I'm still struggling to imagine placing the list management code INSIDE the objects themselves. I can put in my next and prev pointers, but the code from going from one...
Just to return to this lists class :
All of my problems are arising from me accessing the previous or next pointer on a node that doesn't have a previous or next node. So, technically, all I need...