0
anyone can help me
#include <stdio.h> #include <string.h> typedef struct { int hour; int minute; int second; }time; void main() { time t; printf("Input Hour: ");scanf("%d",&t,hour); printf("Input Minute: ");scanf("%d",&t,minute); printf("Input Second: ");scanf("%d",&t,second); puts("Time: "); printf("%d : %d : %d", t.hour, t.minute, t.second); } My question: Whats wrong??
2 odpowiedzi
+ 2
Brother you uses &the, hour and &t, minute and &t, second it's wrong right method is
&t.hourand &t.minute and &t.second
+ 2
Adding after Rohit,
void main() is non standard definition. Use int main() instead.