From: "Kenton W. Mellott" Newsgroups: comp.os.msdos.djgpp References: <200308280125 DOT h7S1PFP5020856 AT envy DOT delorie DOT com> Subject: Re: Simple program. Strange results. Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Thu, 28 Aug 2003 02:52:21 GMT NNTP-Posting-Host: 69.21.9.124 X-Complaints-To: abuse AT tds DOT net (TDS.NET Help Desk 1-888-815-5992) X-Trace: kent.svc.tds.net 1062039141 69.21.9.124 (Wed, 27 Aug 2003 21:52:21 CDT) NNTP-Posting-Date: Wed, 27 Aug 2003 21:52:21 CDT Organization: TDS.NET Internet Services www.tds.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "DJ Delorie" wrote in message news:200308280125 DOT h7S1PFP5020856 AT envy DOT delorie DOT com... > > > Thanks for the corrections! DJGPP's help gave no reason for the ampersand. > > The very first line in the scanf documentation is: > > "This function scans formatted text from `stdin' and stores it in the > variables pointed to by the arguments." > > The "pointed to by the arguments" should have indicated that the > arguments are pointers, not values. > > In addition, the examples show: > > scanf("%d %d %s", &x, &y, buf); > > But, if you can suggest a more obvious wording, we'll listen. > > > From what I can grasp, the asterisk symbol means the same thing. > > Though I have yet to really grasp the proper place(s) and form(s) > > for its usage. > > Nope, asterisk is the inverse of ampersand. Ampersand takes the > address of something, converting values into pointers that point to > those values. Asterisks dereference pointers, turning pointers into > the values they point to. I appreciate your clarity on the point. Sincerely, Gregory D. MELLOTT