Question
I need this C++ code converted to C code #include #include #include using namespace std; char *readableTime(long int sec) { // Converts seconds to time
I need this C++ code converted to C code
#include
using namespace std;
char *readableTime(long int sec) { // Converts seconds to time format time_t epoch_time = (time_t)sec;// Convert to character format return asctime(localtime(&epoch_time)); }
void readFile() { ifstream rFile1, rFile2; rFile1.open("Data1_in.txt"); rFile2.open("Data1_out.txt"); string data1, data2; long int time1, time2; string message1, message2; string phoneNo1, phoneNo2; rFile1>>time1; rFile2>>time2; rFile1>>phoneNo1; rFile2>>phoneNo2; data1 = readableTime(time1); data2 = readableTime(time2); getline(rFile1, message1); getline(rFile2, message2);
while(!rFile1.eof() && !rFile2.eof()){ if(data1.compare(data2) < 0) { cout<<" "<
else {
cout<<" "<
while(!rFile1.eof()){ cout<<" "<
while(!rFile2.eof()) { cout<<" "<
int main(){ readFile(); }
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