Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!darkstar!ucschu.ucsc.edu!ericg From: ericg@ucschu.ucsc.edu (Eric Goodman) Newsgroups: comp.lang.c++ Subject: Re: How to declare a reference to ptr var Message-ID: <7610@darkstar.ucsc.edu> Date: 8 Oct 90 19:25:03 GMT References: <1990Oct1.163755.20207@bnrgate.bnr.ca> Sender: usenet@darkstar.ucsc.edu Organization: UC Santa Cruz Lines: 21 In article <1990Oct1.163755.20207@bnrgate.bnr.ca> gwaters@bwdls35.bnr.ca (Glenn Waters) writes: > I have a variable that is declared: > char *x; > I want to call a function saying: > f(x); > How do I declare the function, such that x comes in as a reference var. As said in another response, you can't have a pointer to a reference. It's possible to get a reference to the *pointer* using this scheme. If you want to get a reference to the dereferenced pointer, you need to dereference it yourself: f(char &xr)... main(){ f(*x); } Eric Goodman, UC Santa Cruz ericg@ucschu.ucsc.edu ericg@ucschu.bitnet