Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!lll-crg!caip!brl-adm!brl-smoke!brl-sem!ron From: ron@brl-sem.UUCP Newsgroups: net.lang.c Subject: Re: sizeof "string"? multi-line macro usage? Message-ID: <349@brl-sem.ARPA> Date: Sun, 13-Jul-86 20:04:00 EDT Article-I.D.: brl-sem.349 Posted: Sun Jul 13 20:04:00 1986 Date-Received: Mon, 14-Jul-86 07:25:49 EDT References: <343@vu-vlsi.UUCP> Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 10 In article <343@vu-vlsi.UUCP>, colin@vu-vlsi.UUCP (Colin Kelley) writes: > Question 1. > > Is it (portably) legal for sizeof to operate on a string constant? Yes, "A string is a sequence of characters surrounded by double quotes [and] has type 'array of characters.'" and "[Sizeof] when applied to an array, the result is the total number of bytes in the array." Hence, sizeof "foo" should return 4.