Why are string literals zero-terminated?

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Tue Jul 20 06:26:56 PDT 2010


On Tue, 20 Jul 2010 14:59:18 +0200, awishformore wrote:

> Following this discussion on announce, I was wondering why string
> literals are zero-terminated. Or to re-formulate, why only string
> literals are zero-terminated. Why that inconsistency? What's the
> rationale behind it? Does anyone know?

So you can pass them to C functions.

-Lars


More information about the Digitalmars-d-learn mailing list