Search:

Type: Posts; User: go_loco

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    2,016

    Oh, ok. I think I get it. So no need to create...

    Oh, ok. I think I get it. So no need to create one because it has already been created for me. I then just need to take that iterator that was just created by the std::find and place it into the...
  2. Replies
    14
    Views
    2,016

    I apologize but I'm pretty new to C++ and I'm...

    I apologize but I'm pretty new to C++ and I'm trying to learn stuff the prof. hasn't taught us yet. I understand an iterator to be like a pointer. So what your saying is that I need to create an...
  3. Replies
    14
    Views
    2,016

    hm.... so here is what I have of my remove...

    hm.... so here is what I have of my remove function:



    void remove(int x)
    {
    cout << "What integer would you like to remove from the bag?" << endl;
    cin >> x;

    int match1 = x;
  4. Replies
    14
    Views
    2,016

    EDIT: Hey, sorry I didn't see your post before...

    EDIT:

    Hey, sorry I didn't see your post before I replied. I agree I would much rather put the prompts for filling the bag and what not in the main. However, the instructor wants us to prompt the...
  5. Replies
    14
    Views
    2,016

    Thanks guys I really appreciate the help!! I...

    Thanks guys I really appreciate the help!!

    I have one more question and I should be home free.

    I have a function called "remove" I am needing to search the vector and then remove that integer...
  6. Replies
    14
    Views
    2,016

    Thanks! I had seen that one and messed around...

    Thanks! I had seen that one and messed around with it too but couldn't get it to work. What's the difference between find and search?
  7. Replies
    14
    Views
    2,016

    Searching for an int in a vector

    Hi,

    I am needing to take a vector and search it for a certain integer.

    The goal:

    To search a vector and confirm or deny if a certain integer is there.

    The problem:
  8. Well I really am unclear on maps. I have yet to...

    Well I really am unclear on maps. I have yet to find an example to actually help me. the examples with strings dont do me any good.
  9. ok well I wasn't really grasping the map issue...

    ok well I wasn't really grasping the map issue mostly cause all the examples online never did it for ints and ints. So I tried to go with something else.

    Here is what I got:



    #include...
  10. ok this map stuff is kinda blowing my mind, but I...

    ok this map stuff is kinda blowing my mind, but I think after looking at that page I'm a little close.

    So when you say:

    map<int, int> counts;

    Does this just say that you are comparing two...
  11. So would I be correct in using this? ...

    So would I be correct in using this?


    size_type count(const key_type& key) const;


    I was thinking I could have it search the vector for the values 0-100? If I did that where would it then...
  12. ok I'm trying to understand this map concept....

    ok I'm trying to understand this map concept. Would you mind trying to explain it and maybe a small example, unrelated to my assignment. I don't want answers. I want to understand this map concept.
  13. Haha ok....So now that I am using a vector I'm...

    Haha ok....So now that I am using a vector I'm back to the question of " How can I count the occurrences of a certain number and then have it print out how many times that number occurred." This is...
  14. Yea we assume X is non negative. Sorry I failed...

    Yea we assume X is non negative. Sorry I failed to mention that.

    Right after i posted I found the .begin that you posted above. I just added that to my sort statement and it worked just fine.
    ...
  15. ok... so I've rewritten my code using a vector...

    ok... so I've rewritten my code using a vector instead. Here is what I have so far....



    #include <iostream>
    #include <vector>
    using namespace std;

    int main()
    {
  16. I'm sorry I'm just starting to use C++. So am I...

    I'm sorry I'm just starting to use C++. So am I not able to use unique to get rid of the duplicate numbers that may be entered?
  17. need help using unique and counting instances of a number

    I am having the user enter in a series of numbers into an array. I am then wanting to order that set of numbers from lowest to highest while deleting and duplicate numbers they may have entered.
    ...
Results 1 to 17 of 17