Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!brl-smoke!smoke!jl42@andrew.cmu.edu From: jl42@andrew.cmu.edu (Jay Mathew Libove) Newsgroups: net.lang.c Subject: Char vs. Int Message-ID: <3770@brl-smoke.ARPA> Date: Sat, 13-Sep-86 04:18:38 EDT Article-I.D.: brl-smok.3770 Posted: Sat Sep 13 04:18:38 1986 Date-Received: Sat, 13-Sep-86 09:51:43 EDT Sender: news@brl-smoke.ARPA Lines: 24 I have always been under the impression that a CHAR variable and an INT variable were the same in 'C'- yet I now see: Message-Id: <1219@drutx.UUCP> Date: 8 Sep 86 02:52:47 GMT To: info-c@brl-smoke.arpa In the sequence: main() { char c = 'w'; foo(c) } foo(ch) char ch; char ch is the correct declaration. The compiler/code generator should handle pulling the character portion of the promoted variable off the stack correctly. Declaring it 'int' is asking for trouble. Why is it asking for trouble to declare ch as INT when K&R says they are the same?