Search:

Type: Posts; User: klawson88

Search: Search took 0.00 seconds.

  1. Yea, its not a habit of mine but I only posted it...

    Yea, its not a habit of mine but I only posted it over there when no replies came in after several hours of the topic being up here. I just assumed no one would answer.
  2. Thanks for your help Elysia. I've made your...

    Thanks for your help Elysia. I've made your specified changes. That, along with the fact that the line right before the return in storeLine should have been


    pwalker -= (length-1)

    ...seems to...
  3. Beginner casting and malloc/realloc question!

    EDIT: Changed some of the code around.

    Doing K&R exercise 5.13... which is supposed to take any amount of input lines and then print the last "n" lines. They wanted dynamic storage which is weird...
  4. Ok, but what exactly is the name "example"...

    Ok, but what exactly is the name "example" pointing to? Dereferencing it iis either giving me a garbage value or a memory address (I can't tell).

    And how does dereferencing anything give you an...
  5. Woops... brain fart. How could I miss something...

    Woops... brain fart. How could I miss something so obvious! Thanks. I however, have another question concerning multi-dimensional arrays and pointers.

    Suppose we have a 2-D array "example"



    ...
  6. Can someone explain this to me (beginner w/ pointers)?

    Hi,

    So I'm doing the K&R book chapter on pointers. This isn't the first time i've learned about the topic, so reading it has given me what I thought was a good grasp on the topic. However, one of...
  7. Ah! Looks like the gods of C have an error in...

    Ah! Looks like the gods of C have an error in their book!

    Thanks... it was driving me crazy.
  8. Why is my symbolic constant not global? K&R problem related

    Hi,

    I'm having a problem with one of the sample programs in the K&R book (second edition). Its the calculator program in chapter 4.

    A good portion of questions in that chapter revolve around...
  9. Replies
    12
    Views
    1,858

    AH! It all makes sense now! Sharke, the way...

    AH! It all makes sense now!

    Sharke, the way you explained it is fantastic!

    Thanks to everyone for their help.
  10. Replies
    12
    Views
    1,858

    What? Shouldn't indicator[0] be replaced with...

    What? Shouldn't indicator[0] be replaced with "indicator" then (if "indicator" is pointing to the first char in the array, and i'm looking for that)? Why would it be indicator[0]?
  11. Replies
    12
    Views
    1,858

    So would this be correct? I'm trying to get the...

    So would this be correct? I'm trying to get the first character in the indicator and hash it:



    int hash (int num, char *indicator)
    {
    int ascii = indicator[0];
    return ascii%num;
    }
  12. Replies
    12
    Views
    1,858

    I don't understand. If it is of type "pointer to...

    I don't understand. If it is of type "pointer to char" (one character), how exactly are you able to manipulate it like a string (multiple characters)?
  13. Replies
    12
    Views
    1,858

    Pointers confusing me (Newbie questions)

    My professor is having us define methods (which he has provided the headers for), and they take in:


    char *indicator

    as a parameter.

    This is a pointer named "indicator" of type char......
  14. Using that cast causes the code not to...

    Using that cast causes the code not to compile.... "error C2296: '^' : illegal, left operand has type 'unsigned int *' "

    Ugh... why do I have a feeling that i'm missing something simple?
  15. It's an HW assignment... and my professor told us...

    It's an HW assignment... and my professor told us to use the (unsigned int) typecast.

    I'm just REALLY confused about what happens when I do the operation and how I can get a node from it.

    So...
  16. Couple of questions about XOR linked lists...

    Ok, I get the basic concept of an XOR linked list... but I have a couple of questions concerning manipulation of the list.

    1. How would you remove the head or tail? I'm familiar with Java, so what...
Results 1 to 16 of 16