Question
I ran this program on Visual 2015, and it gives me errors. how can I fix it? #include stdafx.h #include #include int main() { time_t
I ran this program on Visual 2015, and it gives me errors. how can I fix it?
#include "stdafx.h"
#include
#include
int main()
{
time_t timer;
char buffer[26], ch;
struct tm* tm_info;
time(&timer);
tm_info = localtime(&timer);
printf("Enter your option: \t"
"D: Display date and time \t"
"U: Unblock the queue \t"
"P: Print the current status of process \t"
"T: Print the process time and exit ");
scanf("%c", &ch);
switch (ch)
{
case 'D': strftime(buffer, 26, "%m-%d-%Y %H:%M:%S", tm_info);
puts(buffer);
break;
case 'U':
break;
case 'P': system("ps");
break;
case 'T':
break;
default:
printf("Invalid option ");
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started