28-08-2007, 03:41 PM
Please clarify. ISO/IEC 9899:1999 C standard considers plain char type an \"integer type\":
Is my understanding correct, that we don't consider character constants an \"integer type\"?
So this is also not a violation of 10.1 rule:
I understand we still consider variables of signed/unsigned/plain char types as a \"integer types\"?
Quote:The type char, the signed and unsigned integer types, and the enumerated types are collectively called integer types.
Is my understanding correct, that we don't consider character constants an \"integer type\"?
So this is also not a violation of 10.1 rule:
Code:
unsigned int c = 'x'; /* Not a \"conversion from signed to unsigned\" violation? */
I understand we still consider variables of signed/unsigned/plain char types as a \"integer types\"?
Code:
void foo(int x) {
unsigned int c = x; /* Violation: conversion from signed to unsigned. */
}