Search:

Type: Posts; User: Freddy92

Search: Search took 0.01 seconds.

  1. Yes, the problem was using a non-const iterator...

    Yes, the problem was using a non-const iterator in a const function. Thanks. Also used Caligulaminus code in place of mine; that is working too.
  2. Having trouble printing out values from a map of maps

    Hi guys, as the title states, I'm having some trouble going through a map of maps and printing out all of the values. Here is my declaration of the map:


    map<T, map<T, int> > adjList;


    And...
  3. Replies
    2
    Views
    839

    Is point to this variable?

    Edit: Title supposed to be "Is there a point", sorry.

    So my book has this example program meant to show how to use stacks and queues. It uses a stack to determine if a group of characters in a...
  4. Need help with an error in my linked list class

    Edit: I fixed my initial problem, but now I am getting this linker error that I can't figure out:

    Hi guys, I'm trying to make a template linked list class, but I keep getting this error when I try...
  5. Replies
    5
    Views
    1,232

    Well, I probably should have included what I'm...

    Well, I probably should have included what I'm thinking the answer is, because I guess I do look like some idiot trying to get a free answer. The > operator will be called, and then if Item is not a...
  6. Replies
    5
    Views
    1,232

    Does this question make any sense?

    Preparing for my 2nd semester C++ class final here, and this is one of the practice problems we have:


    //Consider the following defnition:

    template<class Item>
    Item maximal (Item &a, Item...
  7. Replies
    1
    Views
    2,788

    LNK2019 unresolved external symbol

    I'm working on a program that reads in values from a file 3 at a time and stores them separately in a vector. I keep getting this error when I run the program, and I can't figure out why. The class...
  8. Problem with overloading the

    For my program, I'm trying to overload the << operator and make it a friend of the Template, but I'm getting an error when I try to build the program. My book does not at all cover how to do this,...
  9. Thanks a lot, that really helped. I got my...

    Thanks a lot, that really helped. I got my problem all fixed up and my whole program is working now. Thank you good sir!
  10. So, I have to use the same return type and...

    So, I have to use the same return type and parameters as functions I'm trying to override? I didn't think that that's what I learned, and I can't find an example of this anywhere in my book. Could...
  11. Derived class is still an abstract class, not sure why. Help please!

    So basically I'm making a program that has a Vehicle abstract base class and derived classes Truck and Car. From my understanding, a derived class must simply override all pure virtual functions in...
  12. Well, I'll be darned. Thank you for the nice...

    Well, I'll be darned. Thank you for the nice explanation, it's working now.
  13. I thought that it was doing that with the...

    I thought that it was doing that with the set_fraction function it called. Is it not?
  14. New to classes with dynamic memory, looking for some help

    So I'm pretty new to classes in general, and I'm just now making my first attempt at a class with dynamic memory allocation. I made a Rational class that does arithmetic on fractions, with private...
  15. Replies
    4
    Views
    2,437

    Thanks for the responses. I fortunately was able...

    Thanks for the responses. I fortunately was able to find my error and the program now works. The only problem I had left was not including the [] in my deletes of arrays. I did it in one case but...
  16. Replies
    4
    Views
    2,437

    Debug Assertion Failed

    I am trying to get a program I wrote to work but I am having a problem. The program is supposed to make use of multiple levels of indirection so that I can get more familiar and comfortable with...
  17. Replies
    5
    Views
    1,111

    Sorry for the double post, I just have another...

    Sorry for the double post, I just have another question and didn't see an edit button.

    I was trying to figure out when it would be legal to use the ++ operator on an array. For instance, if you...
  18. Replies
    5
    Views
    1,111

    Thank you very much.

    Thank you very much.
  19. Replies
    5
    Views
    1,111

    Need help with a small problem

    Given the following program :



    #include <iostream>
    using namespace std;

    struct quest
    {
    int * ptr;
Results 1 to 19 of 19