Mail Archives: djgpp/1998/10/12/06:46:32.1
TRINITE wrote:
>
> try
>
> #include <conio.h>
This is a very bad idea. The non-standard header <conio.h> is no
substitute for the standard header <stdio.h>
> 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);
The two &s in the printf need to be removed.
> 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 <conio.h>
> > 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;
> > }
--
Martin Ambuhl (mambuhl AT earthlink DOT net)
Note: mambuhl AT tiac DOT net will soon be inactive
- Raw text -