Search:

Type: Posts; User: Lawson

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    999

    Yeah, I have. I added the *List so that the rest...

    Yeah, I have. I added the *List so that the rest of the code snippet makes sense without adding more. I was being lazy.




    Typically if I don't care about the order of the linked list, i'll...
  2. Replies
    2
    Views
    999

    void * allocation.

    Hey guys/girls/other.

    got a quick question.

    So I'm working on a personal project and I'm trying to make all my data structures general so that I can reuse them. My program is working fine, but...
  3. Replies
    1
    Views
    463

    sin() and cos() to draw shapes

    Hi everyone, I have a question. Typically, I don't do anything 'graphical' when it comes to programming. however, I've been tinkering with it lately. I'm trying to learn how to draw shapes using...
  4. Thread: Return broken?

    by Lawson
    Replies
    2
    Views
    287

    Ohhh, derp! thank you. Still a bit of a newbie...

    Ohhh, derp! thank you. Still a bit of a newbie when it comes to recursion, forgot all about that.
  5. Thread: Return broken?

    by Lawson
    Replies
    2
    Views
    287

    Return broken?

    int search(b_s_tree *tree, int key)
    {
    node *temp = helper_search(tree->root, key);
    printf("DEBUG MSG: returned to search() and about to return key\n");

    if (temp != NULL)
    ...
  6. Replies
    4
    Views
    417

    When you say translation unit, you just mean two...

    When you say translation unit, you just mean two static functions with the same name inside the same source file?

    Never mind, you already answered that question!

    Thank you laserLight.
  7. Replies
    4
    Views
    417

    So, let me make sure I have this right. If I...

    So, let me make sure I have this right.

    If I have two source files, both have a function called process().. even though they are helper functions and not included in any header file, there will be...
  8. Replies
    4
    Views
    417

    Static functions for data hiding.

    Hi everyone, just curious. When creating C files that interact with other C files, normally this is managed through the .h file(s).

    By excluding function declaration prototypes from the .h...
  9. Replies
    4
    Views
    384

    Yeah, that actually makes a lot of sense. Thanks...

    Yeah, that actually makes a lot of sense. Thanks for that mate!
  10. Replies
    4
    Views
    384

    Nominal Animal...

    Nominal Animal, yeah that is what I was suspecting, just wanted to know if there was a better way to do it.
  11. Replies
    4
    Views
    384

    bin-search-tree inorder issue

    I've actually created a successful Bin-search-tree in a single file.

    However, I'm trying to layer my code so that one file has a node type, the second a binary tree with a node type etc.

    Now,...
  12. Replies
    6
    Views
    600

    Probably going to echo some of the comments...

    Probably going to echo some of the comments already. The best thing you can do is code. Code as much as you can, start by coding every single code example in books you read on the subject.

    Then...
  13. Replies
    8
    Views
    417

    Hi, me again! just one more question (i know I...

    Hi, me again! just one more question (i know I said the last one was the last question, but this really is).

    What you suggested works perfectly (and was the answer I was looking for). I'm trying...
  14. Replies
    8
    Views
    417

    You're awesome, thank you very much for...

    You're awesome, thank you very much for explaining.
  15. Replies
    8
    Views
    417

    Didn't know you could do that. That makes a lot...

    Didn't know you could do that. That makes a lot more sense!

    Last question (promise :P). macros are taken care of during the 'prepossessing' stage.. not sure about enums, is there a performance...
  16. Replies
    8
    Views
    417

    Probably getting my terminology all mixed up...

    Probably getting my terminology all mixed up again. I thought it was only a macro if you did something like:



    #define ADD(x, y) (x) + (y)


    and symbolic constant when doing something like...
  17. Replies
    8
    Views
    417

    Enums Vs symbolic variables.

    I've always used symbolic variables, typically to remove magic numbers, but also to make my code more readable. As you're aware some of the best books in C are really old so compilers have changed a...
  18. Replies
    3
    Views
    420

    it's all personal preference. Depends on what O.S...

    it's all personal preference. Depends on what O.S you're using. Typically, I prefer to use a note pad and a terminal. TextWrangler on a mac and something like NotePad++ for windows. As for a...
  19. Replies
    8
    Views
    479

    Isn't unsigned (in this context) simply an alias...

    Isn't unsigned (in this context) simply an alias of unsigned int?

    So the two code snippets are the same thing, one is using the alias for unsigned int while the other is being more explicit.
    ...
  20. Thread: debug a program

    by Lawson
    Replies
    15
    Views
    1,075

    Awesome, never compiled in a terminal before! ...

    Awesome, never compiled in a terminal before!

    Elkvis,
    His referring to visual studio.



    Sure, if it breaks. You have a bug! Find it, fix it. gcc isn't 'debugging' anything, it is compiling.
  21. Thread: debug a program

    by Lawson
    Replies
    15
    Views
    1,075

    yeah, really don't use windows. :D good to know...

    yeah, really don't use windows. :D good to know you can though.
  22. Thread: debug a program

    by Lawson
    Replies
    15
    Views
    1,075

    gcc and a.out are unix terminal commands to...

    gcc and a.out are unix terminal commands to compile a c program. Since you're using windows, you won't need to or have access to those commands (someone please correct me if I am wrong). So forget...
  23. Replies
    9
    Views
    487

    Ah, ok cool. Thanks for clearing that up, must...

    Ah, ok cool. Thanks for clearing that up, must have misunderstood - what you're saying makes sense now that I think about it.
  24. Replies
    9
    Views
    487

    Yeah, you can do it that way. It's been drummed...

    Yeah, you can do it that way. It's been drummed into me that doing that way isn't a good idea. I've been taught the following:

    if you're passing a variable address to a pointer, always use:

    ...
  25. Replies
    9
    Views
    487

    A few problems with this code, this is how you do...

    A few problems with this code, this is how you do it.




    #include <stdio.h>
    #include <stdlib.h> // this library allows you to use malloc ;)

    void testadd(int **i);
Results 1 to 25 of 36
Page 1 of 2 1 2