Multichar literals
Ellery Newcomer
ellery-newcomer at utulsa.edu
Fri Nov 12 22:03:53 PST 2010
On 11/12/2010 11:28 PM, Rainer Deyke wrote:
> On 11/12/2010 20:02, bearophile wrote:
>> In this language a single quote can encompass multiple characters.
>> 'ABC' is equal to 0x434241.
>
> I seem to recall that this is feature is also present in C/C++, although
> I can't say that I've ever used it.
>
>
Oh wow.
#include <stdlib.h>
#include <stdio.h>
void main(void){
int i = 'ABC';
printf("0x%x\n", i);
}
yields:
0x414243
And that's backwards from what I would have expected
More information about the Digitalmars-d
mailing list