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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!