Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!olivea!tymix!cirrusl!sunstorm!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: sizeof() confusion Message-ID: <2665@cirrusl.UUCP> Date: 8 Nov 90 17:28:50 GMT References: <9156@latcs1.oz.au> <27432@mimsy.umd.edu> Sender: news@cirrusl.UUCP Organization: Cirrus Logic Inc. Lines: 17 While we're on the subject of sizeof surprises, here is one that did genuinely throw me off: main() { char c; c = 'c'; /* char variable holds char value */ printf("sizeof c = %d\n", sizeof c); printf("sizeof 'c' = %d\n", sizeof 'c'); printf("sizeof (char) = %d\n", sizeof (char)); } Non-C wizards should try to guess what the program will print before they run the program. -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi