Can anyone show me how to code this C program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone show me how to code this C program?

This program assumes that the text message logs maintained in your phone are stored in two separate files. The first file is all the incoming text messages that you received, the second is all the outgoing text messages that you sent. This program reads these two files and prints your text message history in chronological order. The program takes 2 command-line arguments that represent the log files for all incoming and outgoing text messages. A sample execution is : ./a.out datafile1 datafile2

7th Mar 2018, 7:06 PM
Taylor Conant
3 Answers
+ 1
Without going into a lot of detail, an overview would be something like this.. #include <stdio.h> int main(int argc, char **argv) { FILE *rec_texts = NULL, *snt_texts = NULL; if(argc > 2) { rec_texts = fopen(argv[1], "r"); snt_texts = fopen(argv[2], "r"); // check that both file pointers are not null // read each line pair and print their order fclose(rec_texts); fclose(snt_texts); } else printf("Please provide two files\n"); return 0; }
7th Mar 2018, 8:45 PM
Lewis
Lewis - avatar
0
Yeah sorry ran out of space The format for the two log files is: <EPOCH-time> <phone-num> <words-in-message> <the text message> An EPOCH-time is an integer representing the number of seconds since January 1, 1970.
7th Mar 2018, 9:11 PM
Taylor Conant
0
Still not really understanding 😔 any sample code ?
7th Mar 2018, 9:23 PM
Taylor Conant