string types: const(char)[] and cstring

Walter Bright newshound1 at digitalmars.com
Sat May 26 01:14:38 PDT 2007


Daniel Keep wrote:
> This is what I'm wondering; I thought const and invariant only applied
> to reference types (which is why we have final as storage const), in
> which case, const(char)[] doesn't make any sense...

If you know C++, then const(char)* is the same as:
	const char* p;		// C++
and const(char*) is the same as:
	const char * const p;	// C++


(using * because C++ doesn't have dynamic arrays)



More information about the Digitalmars-d-announce mailing list