Search:

Type: Posts; User: 843

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    4,147

    You're right! I tried again and apparently it...

    You're right! I tried again and apparently it works as it should with the new algorithm. It didn't work with the above which was why I removed them. Thanks for the help! :)
  2. Replies
    4
    Views
    4,147

    Thanks! I implemented a different method, which...

    Thanks! I implemented a different method, which involves creating a set of new lists with all the letters and words sorted alphabetically, which works.

    However, I still can't figure out how to...
  3. Replies
    4
    Views
    4,147

    Finding anagrams in a word list

    I have a word list and a file containing a number of anagrams. These anagrams are words found in the word list. I need to develop an algorithm to find the matching words and produce them in an output...
  4. Thread: strcpy

    by 843
    Replies
    5
    Views
    944

    So that wasn't the problem. I'm confused because...

    So that wasn't the problem. I'm confused because the test lines at the bottom still do not work. The strings are not stored correctly:


    ifstream cargo_in("cargo_input.txt"); //opens input...
  5. Thread: strcpy

    by 843
    Replies
    5
    Views
    944

    How else can I assign a string to an array?

    How else can I assign a string to an array?
  6. Thread: strcpy

    by 843
    Replies
    5
    Views
    944

    strcpy

    I'm trying to assign a string to a string array, but I keep getting the 'cannot convert parameter' error. Here's the syntax I'm using:


    string data;
    string *cargo_name_array;
    cargo_name_array =...
  7. Replies
    2
    Views
    831

    You're right, thanks!

    You're right, thanks!
  8. Replies
    8
    Views
    1,312

    I see, thanks!

    I see, thanks!
  9. Replies
    2
    Views
    831

    Dynamic array problem

    The following program crashes. Can someone please tell me what's wrong in this code snippet?


    int i, n = 0, num;
    string data;

    string *cargo_name_array;
    int *cargo_duration_array;...
  10. Replies
    8
    Views
    1,312

    Yes, but what's a 'map'?

    Yes, but what's a 'map'?
  11. Replies
    8
    Views
    1,312

    Sorry, but I don't think that's what I was...

    Sorry, but I don't think that's what I was referring to. The object names are file1, file2, etc. and I want to assign integer values to them, not to print the result.
  12. Replies
    8
    Views
    1,312

    Appending digits to variable

    Let's say I have the objects file1, file2, file3, ... up to file9.
    I also have an array file_array[i] for i = 1 to 9 with a value assigned to each element.
    How do I assign the array values to the...
  13. Replies
    0
    Views
    870

    Problem reading from file

    I'm having trouble reading from a file with the following format:


    John 51021400
    Mary 51021411
    Steve 51021406
    Aaron 51021403
    Kim 51021408

    For some reason the getline functions do not...
  14. Replies
    7
    Views
    6,205

    Right, my bad.

    Right, my bad.
  15. Replies
    7
    Views
    6,205

    I got it! I was modifying the files as standalone...

    I got it! I was modifying the files as standalone files. I have never bothered with project files before, so the thought never crossed my mind.

    It's not exactly the same problem, because for this...
  16. Replies
    7
    Views
    6,205

    It's okay, I just fixed it. Basically, in all the...

    It's okay, I just fixed it. Basically, in all the cpp codes I #include the corresponding headers, and in the main.cpp I #include both player.cpp and swordsman.cpp. This is the ONLY way I got the code...
  17. Replies
    7
    Views
    6,205

    Class has no constructors

    I have the following codes:

    main.cpp


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

    #include "player.h"
  18. Replies
    3
    Views
    5,723

    For instance, here are the functions for...

    For instance, here are the functions for player::death and player:isDead as defined in player.cpp:


    // report whether character is dead
    bool player::death()
    {
    return playerdeath;
    }

    //...
  19. Replies
    3
    Views
    5,723

    Unresolved external symbols

    main.obj||error LNK2019: unresolved external symbol "public: void __thiscall player::transfer(class player &)" (?transfer@player@@QAEXAAV1@@Z) referenced in function _main|
    main.obj||error LNK2019:...
  20. Replies
    4
    Views
    1,096

    I see, so instead I should have written "ThreeD...

    I see, so instead I should have written "ThreeD ptr = new ThreeD()" instead?

    Got it to work, thanks!

    By the way, is there any difference writing ThreeD() and ThreeD for the object class?
  21. Replies
    4
    Views
    1,096

    Pointing to derived class

    Point is the base class and ThreeD is the derived class. I would like to create a new object dynamically from the derived class via the following code:


    int main()
    {
    Point *ptr = new ThreeD();...
  22. Replies
    6
    Views
    1,251

    I was supposed to write a friend function, not a...

    I was supposed to write a friend function, not a friend class. I just reread the assignment.


    I see.
  23. Replies
    6
    Views
    1,251

    Thanks! Got it :)

    Thanks! Got it :)
  24. Replies
    6
    Views
    1,251

    Thanks! It's part of the assignment. EDIT:...

    Thanks!


    It's part of the assignment. EDIT: Scratch that, I was supposed to write a function, not a class.


    Why?
  25. Replies
    6
    Views
    1,251

    Friendship declaration?

    I've got the following code:


    #include <iostream>
    #include "Fraction.h"
    using namespace std;

    class Fraction_dup {
    friend class Fraction;
    public:
Results 1 to 25 of 135
Page 1 of 6 1 2 3 4