Search:

Type: Posts; User: abrownin

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Good point! This worked: string s; ...

    Good point! This worked:



    string s;
    s = point_type;
    return s;


    I have a separate toString function which does the following:
  2. I managed to solve the problem by replacing ...

    I managed to solve the problem by replacing



    stringstream ss;
    string s;
    ss << point_type;
    ss >> s;
    return s;
  3. Haha I get them all the time, I love programming...

    Haha I get them all the time, I love programming :rolleyes:
  4. Correction: it ignores ALL whitespaces. Not just...

    Correction: it ignores ALL whitespaces. Not just leading ones.
  5. My mistake: getline does NOT ignore leading...

    My mistake: getline does NOT ignore leading whitespaces. I checked the binary tree I was reading chars into and it was the correct length. But, it doesn't PRINT spaces.

    I'll post the printing code...
  6. How can I get ifstream's getline function to include leading whitespaces?

    Hi All,

    I am trying to read in lines in a text file, and the leading whitespaces are important! However the getline function isn't reading in the leading whitespaces. Is this a normal way for...
  7. I solved it! Took me a lot of staring, but it was...

    I solved it! Took me a lot of staring, but it was because every time I added a row I didn't add a new row object.. I was adding the SAME object.

    So modifying the "row number" (or y variable)...
  8. Hi grumpy thanks for your advice - I have since...

    Hi grumpy thanks for your advice - I have since shortened my original post, but I really can't figure out this problem. I know it has to do with these overloaded operators not working correctly, but...
  9. bintree object is not understanding my overloaded operators

    Hi All,

    I am getting the following error regarding inserting items into a bintree:



    terminate called after throwing an instance of 'std::invalid_argument'
    what(): dataItem already in...
  10. Thanks tabstop I'll give it a go tonight if I get...

    Thanks tabstop I'll give it a go tonight if I get a chance and post an update
  11. Thanks hk_, I'll take your advice and implement...

    Thanks hk_, I'll take your advice and implement it, it makes a lot of sense and I agree is much safer.

    tabstop, regarding the following code:


    template <>
    void binnode<mazePoint>::print()
    ...
  12. grumpy, you have totally just solved that part of...

    grumpy, you have totally just solved that part of my problem. It just had to be one of those silly errors, I'd put mazePoint:: too early! It was meant to say:



    string mazePoint::toString()...
  13. I'm afraid I get the exact same error EVOEx, I...

    I'm afraid I get the exact same error EVOEx, I can't for the life of me figure out why..

    If toString was an unknown member though wouldn't the compiler have a problem with it just being mentioned...
  14. If you look at my cpp code you'll see I commented...

    If you look at my cpp code you'll see I commented out a prototype for toString, and the function is included just before the last function (load_maze). So, I uncommented them and am receiving this...
  15. Can't print object's attributes in a binary tree - "no member named 'toString'"

    Hi All,

    This was in another thread but it's a completely new problem so I thought I'd create a new thread...

    I am writing a program for an assignment which uses binary trees to store a text...
  16. Thanks tabstop, that totally worked, now I'm...

    Thanks tabstop, that totally worked, now I'm working on being able to print the "maze". I've been struggling with it all night, but I'm receiving this error:



    binnode.h: In member function...
  17. Oh wow I'm such a dunce - thanks heaps, I'll try...

    Oh wow I'm such a dunce - thanks heaps, I'll try it when I get home and update with the result!
  18. Thanks tabstop, I'll keep that in mind. I wonder...

    Thanks tabstop, I'll keep that in mind. I wonder if you could also help me with the error I'm experiencing?
  19. Hi, Thanks for advice! I think I successfully...

    Hi,

    Thanks for advice! I think I successfully overloaded the operators, so it can compile. However, running the code produces the following error:



    terminate called after throwing an...
  20. Insert() function of custom binary tree template not being used correctly

    Hi All,

    I am writing a program for an assignment which uses binary trees to store a text file (a kind of maze):
    1) Create a maze object which contains a binary tree of rows
    2) Create a row...
  21. Thanks!

    Thanks!
  22. Thanks for your quick response laserlight.

    Thanks for your quick response laserlight.
  23. Am I freeing up the memory used in my program?

    Hi All,

    I've written a program for an assignment which utilises doubly-linked lists using the STL.

    I create a class like so:


    class row
    {
    private:
  24. Thanks for the suggestions guys - I ended up...

    Thanks for the suggestions guys - I ended up doing it quite a slow way, without needing to define my own list. To be honest I'm simply not up to that level yet, I've had a bit of Java experience but...
  25. Replies
    1
    Views
    3,921

    Quick: Alternative to using global variable

    Hi All,

    I have a list of a class "row" - which contains a list of chars.
    I have a static variable "TOTAL_ROWS" for the row class in my code which I want to update every time I add a new row to my...
Results 1 to 25 of 35
Page 1 of 2 1 2