Linked by Owen Anderson on Mon 19th Apr 2004 05:43 UTC
General Development For years the development scene has been dominated by the C family of languages, primarily C itself and its immediate successor C++. Recent years have given rise to other C-descendents, however, such as Sun's Java and Microsoft's C#.
Permalink for comment
To read all comments associated with this story, please click here.
RE: Null Pointers
by J.F. on Fri 23rd Apr 2004 02:34 UTC

There is no need for workarounds like that.
Consider 'char[] a=null; char[] b="ARGH"; char[] c="";'. All of these are pointers:
- 'a' points to null
- 'b' points to a structure with the attributes 'length=4' and a pointer, 'data', to the four bytes '65', '82', '71' and '72'
- 'c' points to a structure with the attributes 'length=0' and a pointer, 'data', to null


I'll go along with that. It's sensible and won't confuse anyone. I still think 'c' above pointing to a structure is extraneous, but it will simplify certain functions in that it can assume that a non-null pointer has a structure. If you added other attributes, it would also automatically handle that.