Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps Newsgroups: comp.lang.c From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: Write-only variables Message-ID: <1989Sep14.183749.12753@jarvis.csri.toronto.edu> References: <561@tigger.planet.bt.co.uk> Date: 14 Sep 89 22:37:49 GMT raph@tigger.planet.bt.co.uk (Raphael Mankin) writes: >How does one declare write-only variables in C? [ explanation of the use of write-only variables deleted ] You cannot write to a variable in C without having an lvalue expression for that variable. All lvalue expressions in C have meaning as rvalues.% Therefore, you cannot declare write-only variables in C. (I think :-)) You can't even fake it with a macro, I don't think. (Like "#define x (x_real + 0)" for faking const.) ajr % humourously, in ansi C, not all lvalue expressions in C have meaning as lvalues (namely, array names).