Search:

Type: Posts; User: brianptodd

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    4,950

    I had originally programmed it that way. I had a...

    I had originally programmed it that way. I had a data member that was a string which I used to pass to functions and stuff. She said that I shouldn't have to do that.

    She said that my class...
  2. Replies
    17
    Views
    4,950

    I'm not sure what the problems would be, this is...

    I'm not sure what the problems would be, this is for a class and I need to write the code this way. I am always into easier and better, but I don't think school operates that way.

    Here is the...
  3. Replies
    17
    Views
    4,950

    derived class from string

    I am writing a class derived from string for use as a field. All I really want (or need) to overload is the insertion and extraction so that I can read from a data file.

    However, when I am trying...
  4. Replies
    11
    Views
    1,351

    I don't think it would be possible to print out...

    I don't think it would be possible to print out the first and last lines, then lines in between....would it? The assignment is vague and only gives the output I originally posted and that a...
  5. Replies
    11
    Views
    1,351

    How does the function decrease the number of...

    How does the function decrease the number of spaces indented?
  6. Replies
    11
    Views
    1,351

    In addition to the other requirements, each line...

    In addition to the other requirements, each line must be indented one space, increasingly and decreasingly. It didn't show up in the post that way.

    Brian
  7. Replies
    11
    Views
    1,351

    recursion problem

    I need to write a program whose output looks like:


    This line was output by call 1.
    This line was output by call 2.
    This line was output by call 3.
    This line was output by call 4.
    ...
  8. Replies
    2
    Views
    4,340

    derived class constructor syntax

    I have written a clock class, with an international clock derived class. I am having problems with the syntax for the constructors in the derived class.

    Here is what I've got in the .h:



    ...
  9. Replies
    7
    Views
    1,158

    Thanks all!

    Thanks all!
  10. Replies
    7
    Views
    1,158

    Right. My bool tells me that if its true, it's...

    Right. My bool tells me that if its true, it's AM, if it's false, it's PM. So if I advance my clock past AM or PM, I need to change from AM to PM, or true to false or vice versa.

    I know I can do...
  11. Replies
    7
    Views
    1,158

    switching a bool

    Can I switch a bool object from another function. I am writing a function that advances a clock a certain number of minutes.

    If the hours end up being more than 12, I need to switch my bool...
  12. Replies
    4
    Views
    1,823

    That made things much worse. Should I be passing...

    That made things much worse. Should I be passing a pointer to the function?
  13. Replies
    4
    Views
    1,823

    print array member function

    I am trying to write a simple function that will print my array of clocks. I have a function called display_time() for the clocks:




    void clock::display_time()
    {
    cout << "Current time is:...
  14. Replies
    1
    Views
    1,826

    reading data from a file

    I am trying to read data from a file and put that data into a link list. My problem is that even if the file is empty, my function still adds junk to my link list.

    Here is the function to read...
  15. Replies
    3
    Views
    2,151

    overloading extraction and insertion

    I have written a field class that inherits from the string class, but I need to overload the << and >> operators to handle input/output to a file but I am having trouble with the implementation.
    ...
  16. Replies
    2
    Views
    12,834

    thanks

    That helped a lot. I need to use a member function to perform the actual removing, but your algorithm helped me get mine straight.

    Thanks.

    Brian
  17. Replies
    2
    Views
    12,834

    removing duplicates from a linked list

    I am trying to write a function that removes duplicates from a linked list.

    Here is the code I have:




    /*
    * Function remove_dups()
    *
  18. Replies
    1
    Views
    1,340

    removing dups from a linked list

    How can I remove nodes with duplicate data from a linked list. I am having trouble writing the while loop.
  19. Replies
    3
    Views
    1,114

    ok

    but what if the node you want to remove is s? how do i access the previous->next that points to s, and switch that to s->next?
  20. Replies
    3
    Views
    1,114

    removing nodes from linked list

    How do I remove an interior node from a singly linked list? I am using a node class with a double data member and a list class.
  21. Replies
    2
    Views
    1,416

    operator overloading question

    I am writing a clock class and am working on the operator overloading to compare two clocks, but my compiler is telling me:

    "bool operator < (const Clock& c1, const Clock& c2) must take exactly...
  22. Replies
    6
    Views
    2,371

    I agree that would be a simpler and more direct...

    I agree that would be a simpler and more direct solution. How would I get both my variables into the function in the first place?
  23. Replies
    6
    Views
    2,371

    Here is what I have so far: #include...

    Here is what I have so far:




    #include <iostream>

    unsigned long factorial(unsigned long n, unsigned long r); // function prototype

    int main()
  24. Replies
    6
    Views
    2,371

    recursive factorial function

    I am having trouble getting started writing a recursive function to calculate a factorial, like this:

    n!/r!*(n-r)!

    Where n and r and numbers entered by the user and the ! represents the...
  25. Replies
    5
    Views
    1,538

    perfect! thanks Magos

    perfect! thanks Magos
Results 1 to 25 of 66
Page 1 of 3 1 2 3