Question: I have a code that goes through a text file and identifies if it is a Read(R) or Write (W) converting hexadecimal values to decimal.

I have a code that goes through a text file and identifies if it is a Read(R) or Write (W) converting hexadecimal values to decimal.
Problems I'm having with this is code is that I can't get it to identify if it's a Read or Write to then translate.
Also I was wondering how would I go about storing the values into a array, similar to a queue. any advice on this would be very helpful.
Heres my code, text file, and output so far.
 I have a code that goes through a text file and
identifies if it is a Read(R) or Write (W) converting hexadecimal values
to decimal. Problems I'm having with this is code is that I
can't get it to identify if it's a Read or Write to

10 int main (int argc, char argv[I) 11 |EN 12 13 char filename [15]: 14 char line [FILELENGTH] 15 long long int number: 16 17 18 19 scanf ("%s", &filename); 20 .c int i - 0 char skip; bxt eb printf ("Whats the filename:): FILE *ifp# fopen (filename , "r"); if (ifpNULL) 21 23 24 25 26 27 28 29 30 printf ("ERROR with file" return 1: while (fgets(line, sizeof (line),ifp) NULL) if (line[i 31 32 line [strlen (line)-1]-D"; printf ("value in Hex: tsin", line) number (int) strtol (line, NULL, 26) printf ("Value in Decimal: idn", number): printf(nla"): 34 36 37 3e 39 40 else if(line( C/C++ Windows (CR-LF) WINDoWS-1252 extfilee main.cpp

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!