Search:

Type: Posts; User: noodle24

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,395

    Binary Tree Problem

    Can anyone see what is wrong with this function the returns the height of a binary tree



    int op::tree_height(const BNODE *mt)
    {


    if(mt == NULL) return 0;
    int left = 0;
  2. Replies
    1
    Views
    6,629

    Simple binary tree height function.

    All I need is a simple function that will return the height of the tree. Can someone please tell me what's wrong with this code...



    int bt::tree_height(const node *mytree)
    {
    if(mytree ==...
  3. Replies
    1
    Views
    913

    Easy Recursive Question

    I am trying to print out is ascending order instead of descending order. Here is my code

    Here is some sample output

    How many boxes do you see? 4

    Now opening box .4
    Now opening box .4.3
    Now...
  4. Replies
    3
    Views
    946

    Data File Help!!!

    I want to update a data file. If a == target then I want it to ignore a b and c and then print the rest of the file to the same file.

    Here is my code



    void list(string target)
    {
    string...
  5. Replies
    6
    Views
    877

    Yes that was just a typo. I have tried ios::app

    Yes that was just a typo. I have tried ios::app
  6. Replies
    6
    Views
    877

    Here is what I have tried... string newdata; ...

    Here is what I have tried...

    string newdata;

    ofstream fout ("data.txt", ios:app);

    fout << newdata;


    When I do this though, it erases everything that was already in it.
  7. Replies
    6
    Views
    877

    Very Simple Data file question...

    I already have a list of stuff in my data.txt file.

    How do I add stuff to that data.txt file without erasing what's already in it?

    Thanks in advance
  8. Replies
    3
    Views
    925

    I'm kind of a newbie and I've been searching...

    I'm kind of a newbie and I've been searching through my book and can't figure out how to do it.
  9. Replies
    3
    Views
    925

    Extremely Basic c++ question?

    I have a bunch of names in a data file. One name, first and last, per line.

    How can I open up the file, read them, and then print them to the screen?
  10. Replies
    2
    Views
    952

    simple template friend question

    Here is the top of my class



    template < class T >
    class TODLLNode
    {
    friend class TODLList;
  11. Replies
    2
    Views
    2,996

    poker full house!!

    I want to print out all 3744 possible poker full houses. Right now I am just assigning cards to be numbers. I'll deal with that later. But here is what I have so far and I'm just getting bad data.
    ...
  12. Thread: poker hands

    by noodle24
    Replies
    3
    Views
    2,056

    OK what if I didn't want to print them out but I...

    OK what if I didn't want to print them out but I just wanted to go through every possible hand and then do something with it later.
  13. Thread: poker hands

    by noodle24
    Replies
    3
    Views
    2,056

    poker hands

    How would I go about printing every possible 5 card poker hand. I know I need a few for loops but I don't understand how I would go about doing it. Thanks in advance!
  14. Replies
    7
    Views
    2,605

    I read the website given and I still can't figure...

    I read the website given and I still can't figure it out.
  15. Replies
    7
    Views
    2,605

    random number generator

    I have an array int arr[10];

    I want to fill the array up with random numbers between

    int low = 5;
    int high = 15;

    How would I do this? From what I know, I think I need the <cstdlib> and I...
  16. Replies
    7
    Views
    4,012

    I'm having a hard time understanding what you are...

    I'm having a hard time understanding what you are saying and putting that into code.
  17. Replies
    7
    Views
    4,012

    So say my private variables are num // # of...

    So say my private variables are
    num // # of elements in the array
    cap // size of the vector
    T * data // the dynamic array

    should I do something like



    T * temp = new T[cap];
  18. Replies
    7
    Views
    4,012

    pop_back() vector class

    I am supposed to implement the void pop_back (); function from the vector class for a project. Does anybody know how to implement this function that removes the last element from the Vect.
  19. Replies
    1
    Views
    1,169

    Why core dump??

    I cant figure out why I continue to get a core dump with this function. I'm trying to print out the numbers 3, 5, 7, 9, 11, 13

    _num, field_size, and num_per_line are all equal to 6 when I call the...
  20. Replies
    5
    Views
    1,812

    I don't know how to put what you said into code....

    I don't know how to put what you said into code. I'm kind of a newbie.
  21. Replies
    5
    Views
    1,812

    easy Vector contructor question

    I have the following constructor



    Vector ( T fill [ ], int size)
    {
    // don't know what goes here
    }

    My private variable are
  22. Replies
    2
    Views
    981

    You're the man. Thanks!!

    You're the man. Thanks!!
  23. Replies
    2
    Views
    981

    matrix multiplying

    I have seen all the other threads but I can't get mine to work. I am trying to multiply two matrices with overloading operators.

    mat[SIZE][SIZE] is my private variable
    SIZE is initalized to 2 for...
  24. Replies
    1
    Views
    868

    printing two dimensional array

    I have a matrix and I need to be able to print out all of its contents. Right now I have it such that const int size = 2;
    And then my matrix is matrix[size][size];

    It needs to work of course so...
  25. Replies
    3
    Views
    1,071

    While loop problems

    I'm new to programming. What is the difference between a while and do while loop?
Results 1 to 25 of 27
Page 1 of 2 1 2