Message-ID: <01BDF5D9.F64C3620.ezfbtri@ezf.ericsson.se> From: TRINITE To: "'djgpp AT delorie DOT com'" Subject: RE: function basics Date: Mon, 12 Oct 1998 12:15:11 +0100 Organization: SYSELOG NETWORKS X-Mailer: Messagerie Internet de Microsoft/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com try #include void prompt( int *hrs, int *mnts) { printf("Plz enter begining time, separating hours & minutes"); scanf ("%d %d", hrs, mnts); } int main() { int hrs1, mnts1; prompt( &hrs1, &mnts1); printf ("U entered %d and %d", &hrs1, &mnts1); return 0; } regards. >does anyone know why the code below displays always the same: 317072 >317068. And to get it read and print data properly? > #include > void prompt( int &hrs, int &mnts) > { > > printf("Plz enter begining time, separating hours & minutes"); > scanf ("%d %d", &hrs, &mnts); > > } > int main() > { > int hrs1, mnts1; > > prompt( hrs1, mnts1); > printf ("U entered %d and %d", &hrs1, &mnts1); > return 0; > }