1178476Sjb/*
2178476Sjb * CDDL HEADER START
3178476Sjb *
4178476Sjb * The contents of this file are subject to the terms of the
5178476Sjb * Common Development and Distribution License (the "License").
6178476Sjb * You may not use this file except in compliance with the License.
7178476Sjb *
8178476Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9178476Sjb * or http://www.opensolaris.org/os/licensing.
10178476Sjb * See the License for the specific language governing permissions
11178476Sjb * and limitations under the License.
12178476Sjb *
13178476Sjb * When distributing Covered Code, include this CDDL HEADER in each
14178476Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15178476Sjb * If applicable, add the following below this CDDL HEADER, with the
16178476Sjb * fields enclosed by brackets "[]" replaced with your own identifying
17178476Sjb * information: Portions Copyright [yyyy] [name of copyright owner]
18178476Sjb *
19178476Sjb * CDDL HEADER END
20178476Sjb */
21178476Sjb
22178476Sjb/*
23178476Sjb * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24178476Sjb * Use is subject to license terms.
25178476Sjb */
26178476Sjb
27178476Sjb/*
28178476Sjb * ASSERTION:
29178476Sjb *	verify the use of char constants
30178476Sjb *
31178476Sjb * SECTION: Types, Operators, and Expressions/Constants
32178476Sjb *
33178476Sjb */
34178476Sjb
35178476Sjb
36178476Sjb#pragma	ident	"%Z%%M%	%I%	%E% SMI"
37178476Sjb
38178476Sjb#pragma D option quiet
39178476Sjb
40178476Sjb
41178476SjbBEGIN
42178476Sjb{
43178476Sjb	char_1 = 'a';
44178476Sjb	char_2 = '\"';
45178476Sjb	char_3 = '\"\ba';
46178476Sjb	char_4 = '\?';
47178476Sjb	char_5 = '\'';
48178476Sjb	char_6 = '\\';
49178476Sjb	char_7 = '\0103';
50178476Sjb	char_8 = '\x4E';
51178476Sjb	char_9 = '\c';		/* Note - this is not an escape sequence */
52178476Sjb	char_10 = 'ab\"d';
53178476Sjb	char_11 = 'a\bcdefgh';
54178476Sjb
55178476Sjb	printf("decimal value = %d; character value = %c\n", char_1, char_1);
56178476Sjb	printf("decimal value = %d; character value = %c\n", char_2, char_2);
57178476Sjb	printf("decimal value = %d; character value = %c\n", char_3, char_3);
58178476Sjb	printf("decimal value = %d; character value = %c\n", char_4, char_4);
59178476Sjb	printf("decimal value = %d; character value = %c\n", char_5, char_5);
60178476Sjb	printf("decimal value = %d; character value = %c\n", char_6, char_6);
61178476Sjb	printf("decimal value = %d; character value = %c\n", char_7, char_7);
62178476Sjb	printf("decimal value = %d; character value = %c\n", char_8, char_8);
63178476Sjb	printf("decimal value = %d; character value = %c\n", char_9, char_9);
64178476Sjb	printf("decimal value = %d; character value = %c\n", char_10, char_10);
65178476Sjb	printf("decimal value = %d\n", char_11);
66178476Sjb
67178476Sjb	exit(0);
68178476Sjb}
69