Search:

Type: Posts; User: lime

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    5,335

    thanks everyone

    Salem's suggestion did the trick. Thanks everyone.
  2. Replies
    8
    Views
    5,335

    ignore "int receiver"

    Ignore the "int receiver" in the struct code. I just copied it from my actual program. It doesn't really have anything to do with this example program (which I can't seem to get working anyway).
  3. Replies
    8
    Views
    5,335

    It still isn't really working please have a look

    #include <stdio.h>
    #include <string.h>

    struct person
    {
    char name[20];
    int receiver;

    };
  4. Replies
    8
    Views
    5,335

    creating multiple files

    If I had an array of structures (like a database say) and I entered in 5 people. How could I make a program that prints out a file for each of the people without actually coding the filename into...
  5. Replies
    1
    Views
    1,314

    Programming C for CGI

    I hear you can program CGI scripts with C or C++. Does anyone know how this is done?

    Also, I read that if you use the unix or linux, you can compile a cgi file out of C or C++. How do you do...
  6. Replies
    2
    Views
    1,131

    Ok I understand now. Thanks. But how would you...

    Ok I understand now. Thanks. But how would you go about overloading an operator? Would it be possible for you to give me a short example? Or a link to a good explanation/example?
  7. Replies
    2
    Views
    1,131

    overloading for newbies

    Hello. I'm new to C++ but I have some knowledge of C. You may laugh because I don't know what overloading means. I've been doing some reading and I have the vauge idea that overloading means you...
  8. is the (int) necessary in front of the log(n)?

    is the (int) necessary in front of the log(n)?
  9. is there a function that counts the digits of an int

    Just curious because it would make printing out an matrix much easier.

    Thanks.
  10. Replies
    2
    Views
    1,583

    ok i have some code here that tells me how to...

    ok i have some code here that tells me how to find the depth


    int depth(NODE *node)
    {
    int left = -1; // clear left
    int right = -1; // and right
    ...
  11. Replies
    2
    Views
    1,583

    wow, that's a pretty compact little recursive...

    wow, that's a pretty compact little recursive function :)
    Would I be able to modify that code so it could count levels as well as the number of elements per level?
  12. Replies
    2
    Views
    1,583

    counting depth and elements of a tree

    Uh hi, it's me again. I have another question.
    It's another one about binary search trees.

    I made one that works. I can tell that it works by traversing it in order. I've seen a lot of...
  13. would NELEM(x) also work for arrays of pointers?

    would NELEM(x) also work for arrays of pointers?
  14. Is there a way to find the number of elements in an array?

    Here's a simple question that I don't know the answer to. I hope someone knows a trick or two.

    Say you have two arrays and you want to make a single function to print the out the elements. One...
  15. Replies
    9
    Views
    35,300

    AHA I figured it out. I have to add an else...

    AHA I figured it out. I have to add an else statement to decrement i (in the for loop in the randomWords function) if a repeated word has been found. (because the for loop would stop at 100 anyways...
  16. Replies
    9
    Views
    35,300

    Ok i do have it working but not properly. This...

    Ok i do have it working but not properly. This time, it's giving me 192 random words when it should be giving me 100. I also noticed that when I traverse the tree and print the words out, I only...
  17. Replies
    9
    Views
    35,300

    ooohh silly me. Ok I got it working thanks...

    ooohh silly me. Ok I got it working thanks hammer.
  18. Replies
    9
    Views
    35,300

    oh I see, so I would have to type NODE...

    oh I see, so I would have to type

    NODE *somenode;
    somenode=insert(root, words[randnum].word);

    something like that?
  19. Replies
    9
    Views
    35,300

    In that case I suppose I should just post it all....

    In that case I suppose I should just post it all. Thanks for helping me with this problem by the way.


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h> /*to use strcpy*/
    #include...
  20. Replies
    9
    Views
    35,300

    Thanks lightatdawn. I changed that to '=='. ...

    Thanks lightatdawn. I changed that to '=='.

    And thanks Salem. I used your suggestion and took out createtree and used your code for NODE insert(etc...). That seemed to fix the error I was...
  21. Replies
    9
    Views
    35,300

    Inserting words into a binary search tree

    I'm writing a program where I have to randomly choose 100 words from an array and put it into a binary search tree. I got the array working the random selection working but putting the words into...
  22. Replies
    6
    Views
    1,381

    Hey money? the code you suggested actually worked...

    Hey money? the code you suggested actually worked (yay, thanks) but only for the first word I scanned in. so for example in the second list my first word was "house" and then it went through the...
  23. Thread: function list

    by lime
    Replies
    4
    Views
    1,077

    Were you looking for something like this?...

    Were you looking for something like this?
    sqrt(x)?
    It returns the squareroot of x.
    .
    It's included in math.h
  24. Replies
    6
    Views
    1,381

    This is how i defined the linked list: ...

    This is how i defined the linked list:


    /*structure of linked list*/
    struct node{
    char data[9];
    struct node *next;
    };
    typedef struct node NODE;
  25. Replies
    6
    Views
    1,381

    Is there something wrong with this code?

    Hi folks, I have another little problem.

    I've been working on a program that's supposed to compare two text files (of lists of words) and see if they have all the same words (regardless of what...
Results 1 to 25 of 32
Page 1 of 2 1 2