From: Martin Ambuhl Newsgroups: comp.os.msdos.djgpp Subject: Re: Question about pass by pointer Date: Thu, 17 Sep 1998 16:20:00 -0400 Organization: Nocturnal Aviation Lines: 30 Message-ID: <36016EF0.D08D173D@earthlink.net> References: <3600c4ec DOT 1308545 AT news DOT hknet DOT com> NNTP-Posting-Host: 1cust129.tnt12.nyc3.da.uu.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk ¤ý¤ô wrote: > > void change(char *n){ > *n=70; > } > int main(){ > char Number=0; > printf("Number=%i\n",Number); > change(&Number); > printf("Number=%i\n",Number); > return 0; > > What I want to ask is that when the address of Number pass to function > "change", the address value will store in var 'n' , but not '*n' ?! > > Damn, I don't know how to say it....... :( Yes, you have it right. 'n' in change() contains &Number (the address of Number), so the line *n = 70; has the effect of *(&Number) = 70; or *&Number = 70; or Number = 70; -- Martin Ambuhl (mambuhl AT earthlink DOT net) Note: mambuhl AT tiac DOT net will soon be inactive