From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <0522651bfa90c83ddb192a77ddaccb78@swcp.com> <460c4983c43135098e3c1f2b36623833@swcp.com> <764fc0b0ab4cc1f9a890bc61a61a7c81@ladd.quanstro.net> Date: Thu, 29 Jul 2010 20:42:41 -0300 Message-ID: From: "Federico G. Benavento" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] writing to ctl using fprint and write Topicbox-Message-UUID: 44da3fd6-ead6-11e9-9d60-3106f5b1d025 sorry, but I didn't get the point On Thu, Jul 29, 2010 at 12:11 PM, David Leimbach wrote: > > > On Thu, Jul 29, 2010 at 8:04 AM, erik quanstrom > wrote: >> >> > Thanks Erik, Sape, and Skip. =C2=A0That was such a STUPID error, and I= thank >> > you all for the extra eyes. =C2=A0I think it is time for a break and a= bowl >> > of >> > tea... >> >> relax. =C2=A0not stupid, subtle. =C2=A0it takes vigilance to keep >> sizeof, nelem, strlen, and the number of characters >> straight. >> >> - erik >> > > And you *can* use sizeof on arrays :-). > Well at least in ANSI/ISO C. =C2=A0Haven't tried this on plan 9. =C2=A0:-= ) > On my mac I get 6 and 8. > #include > char blah [] =3D "Hello"; > char * blah2 =3D "There"; > int main =C2=A0() { > =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0printf("sizeof blah: %ld\n", sizeof(blah= )); > =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0printf("sizeof blah2: %ld\n", sizeof(bla= h2)); > } > > --=20 Federico G. Benavento