# Search:

Type: Posts; User: Subsonics

Page 1 of 20 1

## Search: Search took 0.02 seconds.

by Subsonics
Replies
58
Views
3,753

### 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...

by Subsonics
Replies
58
Views
3,753

### 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.

by Subsonics
Replies
58
Views
3,753

### 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.

by Subsonics
Replies
58
Views
3,753

### 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...

by Subsonics
Replies
58
Views
3,753

### 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,...

by Subsonics
Replies
58
Views
3,753

### 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.

by Subsonics
Replies
58
Views
3,753

### 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.

by Subsonics
Replies
58
Views
3,753

### ? 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.

by Subsonics
Replies
58
Views
3,753

### 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...

by Subsonics
Replies
58
Views
3,753

### 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:
...

by Subsonics
Replies
58
Views
3,753

### 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
...

by Subsonics
Replies
58
Views
3,753

### 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.

by Subsonics
Replies
5
Views
2,582

### 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.

by Subsonics
Replies
5
Views
2,582

### 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.

by Subsonics
Replies
58
Views
3,753

### Or use calloc.

Or use calloc.
16. ## Thread: sink detection algorithm

by Subsonics
Replies
2
Views
2,815

### 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. ## Thread: remove spaces from string

by Subsonics
Replies
12
Views
1,329

### 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. ## Thread: Enumeration of enums. Is there a way to attain something like this.

by Subsonics
Replies
2
Views
682

### 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. ## Thread: Need suggestions for an algorithm

by Subsonics
Replies
10
Views
1,236

### 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. ## Thread: Need suggestions for an algorithm

by Subsonics
Replies
10
Views
1,236

### 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. ## Thread: pdf to word converter (not online)

by Subsonics
Replies
4
Views
1,290

### 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. ## Thread: Multiple definition errors for seemingly no reason at all

by Subsonics
Replies
7
Views
1,056

### 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. ## Thread: Multiple definition errors for seemingly no reason at all

by Subsonics
Replies
7
Views
1,056

### 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. ## Thread: where do i define a struct in my code using an array class

by Subsonics
Replies
4
Views
797

### The only difference is that in a struct all...

The only difference is that in a struct all members are public by default.
25. ## Thread: Definition of const strings in .cpp files

by Subsonics
Replies
13
Views
1,386

### 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