Question: C Programming: Please explain the following code line by line, the more detail the better Thanks. int i; int idx = 0; int count =

C Programming: Please explain the following code line by line, the more detail the better Thanks.

int i;

int idx = 0;

int count = 0;

int size = 0;

char **files_list_ = (char **) malloc (sizeof (char*) * 100);

char **files_list = (char **) malloc (sizeof (char*) * 100);

char **files_lists;

char **stock_tkr = (char **) malloc (sizeof (char*) * 100);

FILE *fp;

char *dirName = (char *) malloc (sizeof(char) * 30);

char *companyList = (char *) malloc(sizeof(char) *30);

char *outputFile = (char *) malloc(sizeof(char) *30);

int outputFlag = 0;

int dirFlag = 0;

int companyFlag = 0;

int stock_tkr_Flag = 0;

int dcoPresent = 0;

int fileCount = 0;

int stock_tkr_Count = 0;

snprintf(ffname, sizeof(ffname) -1,"%s", files_list[idx]);

Corporation *corp = (Corporation *)malloc(sizeof(Corporation));

get_stock_values(ffname, &(corp->data), &(corp->date), str_delim, &corp->data_rows, &corp->data_cols);

corp->date_length = corp->data_cols;

char *temp = strdup(files_list[idx]);

char *ret = strrchr(temp, '/');

char *STOCK TKR_ = strtok(ret + 1, ".");

free(temp);

FILE *fp1 = fopen(companyList, "r");

char *name;

char * sector;

char *industry;

char *t = strdup(STOCK TKR_);

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!