Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Use of Const keyword in ANSI C Message-ID: <8454@smoke.ARPA> Date: 8 Sep 88 05:23:09 GMT References: <441@optilink.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <441@optilink.UUCP> cramer@optilink.UUCP (Clayton Cramer) writes: > typedef struct Tag > { > const char* C; > } TestType; > Test1.C = "not a test case"; /* compiler accepts this -- bad */ That's okay. You've declared the C member to point to const chars, and set it to point to a string literal. If you want the POINTER to be const, instead of what it points to, try char const * C; "const" is a type qualifer, not a storage class, so its relative position within the type specifiers matters.