ok, so I'm just trying to get this to at least do something that makes sense, so I currently have
Code:
1 #include<stdio.h>
2
3 /*
4 myname
5 classsection
6 10-04-09
7 pe2.c
8 */
9
10 int main(void)
11 {
12 int h1, m1, s1, h2, m2, s2, h3, m3, s3;
13 printf("TIME1# ");
14 scanf("%d:%d:%d", &h1, &m1, &s1);
15 printf("TIME2# ");
16 scanf("%d:%d:%d", &h2, &m2, &s2);
17 s3=(s1+s2);
18 m3=(m1+m2);
19 h3=(h1+h2);
20 printf("%d:%d:%d", &h3, &m3, &s3);
21 printf("PROGRAM ENDS\n");
22 return 0;
23 }
I know this won't keep the output minute and second values under 60 & carry the remainders, but again I'm just trying to get it to do something correctly for now.
when I compile I get these warnings
Code:
pe2.c: In function `main':
pe2.c:20: warning: int format, pointer arg (arg 2)
pe2.c:20: warning: int format, pointer arg (arg 3)
pe2.c:20: warning: int format, pointer arg (arg 4)
and now when I run it I at least can input both values now, but this is what I get (when I enter 12:12:34 and 34:12:73 obviously)
Code:
TIME1# 12:12:34
TIME2# 34:12:73
-4195092:-4195096:-4195100PROGRAM ENDS
what am I doing wrong in line 20?