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...
Type: Posts; User: Subsonics
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...
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.
Yes it is. When I mentioned NULL (all caps) here, I'm referring to the null pointer constant.
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...
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,...
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.
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.
?
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.
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...
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:
...
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
...
An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
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.
What is the return value of thread_func? It's suppose to be void*, you don't seem to return anything.
Or use calloc.
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.
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...
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...
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...
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...
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.
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...
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...
The only difference is that in a struct all members are public by default.
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,...