delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/12/08:50:16

Date: Mon, 12 Oct 1998 13:48:12 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: function basics
In-Reply-To: <3621D7C5.689D9A20@earthlink.net>
Message-ID: <Pine.OSF.4.05.9810121346530.20489-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 12 Oct 1998, Martin Ambuhl wrote:

> Reread the section of your text on the proper form of arguments.
> Consider the differences between the following and your original code:
> 
> #include <stdio.h>
> void prompt(int *hrs, int *mnts)
> {
>     printf("Please enter beginning time, "
>             "hours & minutes separated by whitespace\n"
>             "> ");
>     scanf("%d %d", hrs, mnts);
> }

I don't think there was anything wrong with his original version
of this function -- it just used C++ references.  The only
problem I saw was with the `printf' line taking addresses when
it shouldn't do.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019