Question: // tt.h int ttable [10][10]; int i,j,n,toSearch; FILE * fPtr; void write_tt(void) ; //void read_tt(void); // tt.c #include #include #includett.h //// TO write in file

 // tt.h int ttable [10][10]; int i,j,n,toSearch; FILE * fPtr; void

// tt.h

int ttable [10][10]; int i,j,n,toSearch; FILE * fPtr; void write_tt(void) ; //void read_tt(void);

// tt.c

#include  #include  #include"tt.h" //// TO write in file void write_tt(){ FILE * fPtr; //Open file in w (write) mode. fPtr = fopen("f5.txt", "w"); // path to create file is in same folder /* fopen() return NULL if last operation was unsuccessful */ if(fPtr == NULL) { /* File not created hence exit */ printf("Unable to create file. "); exit(EXIT_FAILURE); } /* Write data to file */ for(i=1;i 

//

/** * C program to create a file and write data into file. */ //main file #include #include

#define DATA_SIZE 1000

int main() { /* Variable to store user content */ // char data[DATA_SIZE]; int ttable [10][10]; /* File pointer to hold reference to our file */ FILE * fPtr;

/* * Open file in w (write) mode. * "data/file1.txt" is complete path to create file */ fPtr = fopen("f4.txt", "w");

/* fopen() return NULL if last operation was unsuccessful */ if(fPtr == NULL) { /* File not created hence exit */ printf("Unable to create file. "); exit(EXIT_FAILURE); }

/* Input contents from user to store in file */ // printf("Enter contents to store in file : "); // fgets(data, DATA_SIZE, stdin);

/* Write data to file */ // fputs(data, fPtr);

for(int i=1;i

/* Close file to save file data */ fclose(fPtr);

/* Success message */ printf("File created and saved successfully. ?? ");

return 0; }

///

This is an individualgrogramming exercise, so l expect you to work on this problem by yourself. All homework problems are individual assignments. What to do Rewrite the three C functions that you developed in the Times Table Character" assignment. Instead of using character-based fle fictions rask you to use binary file IO functions. Specifically, use fread0 fwrite0 and fseeko. What to submit I ask you to submit, here on BBLearn, on or before the due date: e All three code files A screen shot of a run of your driver, having it show the result of 4'5. Hints Piease make sure to include the 'b' flag in all fopen) calls, as Windows will treat your data file as a character file, with confusing offects Grading guide Your submission will be graded according to the following guidelines for a total of 90 points, Grading is going to be done on an "all or nothing" basis no partial credit will be granted at the level of individual bullet points below, with the exception of the commenting/haming/indentation requirement

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!