3.5.1. ? operator

A ? operator whose second and third operands are string literals or wide string literals can be implicitly converted to char * or wchar_t *. In C++ string literals are const. There is an implicit conversion that enables conversion of a string literal to char * or wchar_t *, dropping the const. That conversion, however, applies only to simple string literals. Permitting it for the result of a ? operation is an extension.


char *p = x ? "abc" : "def";
Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A