Search:

Type: Posts; User: patricio2626

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    21
    Views
    2,367

    Aha, that makes sense (top-down). Thank you.

    Aha, that makes sense (top-down). Thank you.
  2. Replies
    21
    Views
    2,367

    Hello again, #include...

    Hello again,


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

    void insert(struct personStruct **root, char firstName[], char lastName[]);
    void display(struct personStruct **root);
  3. Replies
    21
    Views
    2,367

    Aha, so, only use free() when I want to destroy...

    Aha, so, only use free() when I want to destroy my list. I didn't realize that that's what I was doing. Also, when I put the function prototypes below into the file just below the include...
  4. Replies
    21
    Views
    2,367

    Hello again, Ugh, now I remember why I quit...

    Hello again,

    Ugh, now I remember why I quit C++ and never looked back after the transition to Java. DS&A with C++ was next to impossible, because I didn't have a firm grasp on pointers. I...
  5. Replies
    21
    Views
    2,367

    First, excuse me; I should have said never...

    First, excuse me; I should have said never evaluates to null :o. The root is skipped when inserting, and display() causes an infinite loop in which the new value is displayed. Code below:


    ...
  6. Replies
    21
    Views
    2,367

    Actually, looking at limits.h in an attempt to...

    Actually, looking at limits.h in an attempt to answer a question from another poster, I see that my library is indeed GCC :)
  7. Looking at it, you are going up to n=52, so I...

    Looking at it, you are going up to n=52, so I think you're pretty much forced to use a double if you want anything above 10^9 or so. MAX_DBL in float.h is going to be the max value a double can...
  8. Are you sure that this happens on the first...

    Are you sure that this happens on the first iteration? Just curious, what happens if you put a fflush(stdout) after the printf("%d", v) statement, and change it to printf("%d", n)? Maybe it's...
  9. Just curious, what is the value of tmpxp2 at that...

    Just curious, what is the value of tmpxp2 at that point in your debug?
  10. Okay, looking at your screenshot, maybe this is...

    Okay, looking at your screenshot, maybe this is some kind of numeric overflow. Look at the value of tmpxp1, and look at the likely min value of int: –2147483647 – 1.
  11. Interesting. Would you mind posting the new code?

    Interesting. Would you mind posting the new code?
  12. Probably because the possible range of values is...

    Probably because the possible range of values is so large. Maybe you could cast back to int or long?
    *Edit : Nyah Check beat me to the explanation :)
  13. Look up pow. And yes, exc_i386_div = division by...

    Look up pow. And yes, exc_i386_div = division by zero.
  14. Replies
    21
    Views
    2,367

    Hello again, Eclipse with MinGW GCC...

    Hello again,

    Eclipse with MinGW GCC compiler, Windows 7 - what do you mean exactly by 'library'? I did fix the dereferencing (thank you - it makes sense that a pointer to a pointer should be...
  15. Replies
    21
    Views
    2,367

    Thank you. Any idea why root is still evaluating...

    Thank you. Any idea why root is still evaluating as NULL here?:


    #include<stdio.h>
    #include<stdlib.h>



    struct personStruct{
    char first[999];
  16. Replies
    21
    Views
    2,367

    Okay, now, a couple of follow-up questions: 1) I...

    Okay, now, a couple of follow-up questions:
    1) I know that memcpy told me to use stderr, but I was experimenting with omitting fflush(stdout) just before scanf() statements, and no, no text is...
  17. Replies
    21
    Views
    2,367

    Indeed, the below works. Thanks for the tip,...

    Indeed, the below works. Thanks for the tip, memcpy.


    #include<stdio.h>
    #include<stdlib.h>

    struct personStruct{
    char fn[999], ln[999];
    struct personStruct *next;
    }*root = NULL;
  18. Replies
    21
    Views
    2,367

    Okay, this makes sense: since pointers contain...

    Okay, this makes sense: since pointers contain addresses, I was simply changing the value of what was stored in that address, and since I had fn and ln point to firstName and lastName in each...
  19. Replies
    21
    Views
    2,367

    Linked list pointer assignment

    Okay, I'm just trying to insert values into a linked list (structs), and I must be doing the assignments wrong, but I can't see what it might be. Is it not simply tempPtr = tempPtr->next ? Can...
  20. Replies
    5
    Views
    940

    Yep, apparent improper use of ctrl + c :biggrin:

    Yep, apparent improper use of ctrl + c :biggrin:
  21. Replies
    5
    Views
    940

    Sho' nuff! :) The below works, thank you! ...

    Sho' nuff! :) The below works, thank you!



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

    int main(void){
    char c1[888] = "hello!";
  22. Replies
    5
    Views
    940

    C pointer assignment going awry

    Hello all,

    I'm trying to create a simple routine where I transform the individual characters of a character string to uppercase. I'm trying to figure out why I can dereference individual...
  23. Replies
    9
    Views
    1,689

    Thanks for the explanations and patience, guys! ...

    Thanks for the explanations and patience, guys! My new text is much better but still skips a lot of details,
  24. Replies
    9
    Views
    1,689

    Sorry, one more thing... just so I'm clear on...

    Sorry, one more thing... just so I'm clear on this, why is, for example, below, the newString object passed by reference, and not by value if it's not being modified directly?


    bool...
  25. Replies
    9
    Views
    1,689

    Thanks! Excuse the dumb questions; I'm on my...

    Thanks! Excuse the dumb questions; I'm on my second data structs book, because the first one confused me so much, but... when would I ever have newString& as a return type? Is there a case where I...
Results 1 to 25 of 121
Page 1 of 5 1 2 3 4