9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * or http://www.opensolaris.org/os/licensing.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ASSERTION:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * verify the use of char constants
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * SECTION: Types, Operators, and Expressions/Constants
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma D option quiet
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlBEGIN
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_1 = 'a';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_2 = '\"';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_3 = '\"\ba';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_4 = '\?';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_5 = '\'';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_6 = '\\';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_7 = '\0103';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_8 = '\x4E';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_9 = '\c'; /* Note - this is not an escape sequence */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_10 = 'ab\"d';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char_11 = 'a\bcdefgh';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_1, char_1);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_2, char_2);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_3, char_3);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_4, char_4);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_5, char_5);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_6, char_6);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_7, char_7);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_8, char_8);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_9, char_9);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d; character value = %c\n", char_10, char_10);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("decimal value = %d\n", char_11);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl exit(0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}