Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Discuss consumer-driven health plans.

Answered: 1 week ago