I was working on a program which reads a input in seconds from the user. This program compiles fine but when I enter a value for the seconds it crashes. I used this program to test the assignment of a value to a time_t variable
But when I execute this code, after entering a number, I get
any insight?
Code:
#include<stdio.h>
#include<time.h>
int main() {
time_t t;
scanf("%lld", &t);
printf("%lld\n", t);
return 0;
}
Code:
Segmentation fault: 11 (core dumped)