Search:

Type: Posts; User: Subsonics

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    58
    Views
    3,397

    Well the way it is expressed in the standard: ...

    Well the way it is expressed in the standard:



    Does leave open for the possibility of other integer constant expressions (any integer constant expression in fact) to also be called a null...
  2. Replies
    58
    Views
    3,397

    Lets first establish what it is you are...

    Lets first establish what it is you are disagreeing with. "No it is not" subtle or "no it is not" required to be 0. Because there is nothing in post # 31 that I disagree with.
  3. Replies
    58
    Views
    3,397

    Yes it is. When I mentioned NULL (all caps) here,...

    Yes it is. When I mentioned NULL (all caps) here, I'm referring to the null pointer constant.
  4. Replies
    58
    Views
    3,397

    Well that's subtle, especially since the value of...

    Well that's subtle, especially since the value of NULL is required to be 0. It would be interesting to know of one practical example of this on this side of the seventies, and the rationale for...
  5. Replies
    58
    Views
    3,397

    See, that's what I don't get. If you assign NULL...

    See, that's what I don't get. If you assign NULL to a pointer, and NULL is 0 or (void*)0, then the only way the value the pointer would get by being initialized to 'all bits zero' could be different,...
  6. Replies
    58
    Views
    3,397

    In that case it's only because 0 does not...

    In that case it's only because 0 does not necessary have to be 'all bits zero' no?



    Well exactly, there was no section 7.22.3.2 where ever I looked.
  7. Replies
    58
    Views
    3,397

    Of course you did! You want to use: malloc(some...

    Of course you did! You want to use: malloc(some stuct size) then explicitly set each each member to NULL, calloc sets the entire memory region to 0.
  8. Replies
    58
    Views
    3,397

    ? I'm sorry, that is the entire basis of the...

    ?

    I'm sorry, that is the entire basis of the discussion. You want to explicitly initialize pointers to NULL, because you think that somehow makes a difference from zero.
  9. Replies
    58
    Views
    3,397

    Eh, you are the one who claim that: *P = NULL is...

    Eh, you are the one who claim that: *P = NULL is different from *p = 0 or *p = (void*)0. Well, let's go back and look what value the NULL pointer constant has then because that is the value that *p...
  10. Replies
    58
    Views
    3,397

    The value is 0 since the NULL pointer is either 0...

    The value is 0 since the NULL pointer is either 0 or (void*)0.

    Assigning *p = 0, or *p = (void*)0 is equivalent to NULL. calloc in this case will set it to 0.

    Some public backup:
    ...
  11. Replies
    58
    Views
    3,397

    No. My post is directly taken from the C...

    No. My post is directly taken from the C standard. It's been the same since ansi C, so you need to go back pre standard C to find any substance to what you are talking about.

    NULL is either

    0
    ...
  12. Replies
    58
    Views
    3,397

    An integer constant expression with the value 0,...

    An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
  13. What makes you say so? It's a runtime error. Look...

    What makes you say so? It's a runtime error. Look at the warnings:




    Surely there is no way that following an int, in the belief that it's a void* can lead to a segfault.
  14. What is the return value of thread_func? It's...

    What is the return value of thread_func? It's suppose to be void*, you don't seem to return anything.
  15. Replies
    58
    Views
    3,397

    Or use calloc.

    Or use calloc.
  16. Replies
    2
    Views
    2,555

    Since this is a digraph couldn't you do a...

    Since this is a digraph couldn't you do a topological sort on it? The nodes without any incoming edges should appear in either end, depending on sort order afaik.
  17. Replies
    12
    Views
    1,205

    At the time you return str_buf it points to the...

    At the time you return str_buf it points to the last character: '\0'. To free this memory you would need to capture that pointer from remove_space so you can free it main. Edit: that would not work...
  18. You could divide your datatype into ranges, for...

    You could divide your datatype into ranges, for example if the above represents a byte (ignoring the 2 for a moment) then each sub type would be able to carry 3 bits of information. Meaning error...
  19. Replies
    10
    Views
    1,150

    A "weight" can mean anything you want it to in...

    A "weight" can mean anything you want it to in order to fit a graph onto your problem, in this case distance in pixels would be the edge weight. It's not necessarily graph operations that could be...
  20. Replies
    10
    Views
    1,150

    You may be able to represent your nodes as a...

    You may be able to represent your nodes as a graph, where the distance between nodes (vertices) is the edge weight. Ideally I assume you would like to center your node directly under it's...
  21. Replies
    4
    Views
    1,246

    Adobe Acrobat (not free) or similar let's you...

    Adobe Acrobat (not free) or similar let's you edit a pdf document. It's probably better than trying to convert it to Word imho.
  22. I probably should have been more clear. You add a...

    I probably should have been more clear. You add a complementary constants.c file to you constants.h where you define the constants. Alternatively you could use #define instead I guess. Pasting them...
  23. The preprocessor only work on a simple cut and...

    The preprocessor only work on a simple cut and paste principle. So since initialization.h is included in both initialization.c and main.c, your definitions appear twice (since they are simply pasted...
  24. The only difference is that in a struct all...

    The only difference is that in a struct all members are public by default.
  25. Replies
    13
    Views
    1,218

    Don't you think I'm aware of that? But as with...

    Don't you think I'm aware of that? But as with many things it's a balance of what is reasonable in any given situation. I can make a reasonable judgement since I have insight in this situation,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4