Question: C program required. Complete the code below: For a file, if we write its full path, it may look like, WINNTSYSTEM32CERTSRVCERTCO-1X86. You are going to

C program required.

C program required. Complete the code below: For a file, if we

Complete the code below:

write its full path, it may look like, WINNT\SYSTEM32\CERTSRV\CERTCO-1\X86". You are goingto write a program to print each directory on a separate line.Your program should read the input from the file and output theanswer to another file. The first argument is the input file name,while the second argument is the output file name. Name your programas "lab6-93.c. Hint 1. Reuse the program in lab 5, the first-childright-sibling implementation to create the tree. 2. Look for the usage ofstrtok(). Input file: The first line of the input file contains integer

For a file, if we write its full path, it may look like, WINNT\SYSTEM32\CERTSRV\CERTCO-1\X86". You are going to write a program to print each directory on a separate line. Your program should read the input from the file and output the answer to another file. The first argument is the input file name, while the second argument is the output file name. Name your program as "lab6-93.c. Hint 1. Reuse the program in lab 5, the first-child right-sibling implementation to create the tree. 2. Look for the usage of strtok(). Input file: The first line of the input file contains integer n (0 #include #include typedef struct tree_cs { char word[82]; /* key of the node */ struct tree_cs * first_child; /* pointer to the first child */ struct tree_cs * next_sibling; next_sibling; /* pointer to the next sibling */ } Tree_CS; /* Take reference to lab 2 */ int compare(char *a, char *b) { // Your code here return 0; } void sorting (char **path, int n) { // Your code here For debugging, see if path is sorted. */ for (i = 0; ifirst_child = NULL; T->next_sibling = NULL; name = malloc(sizeof(char*)*80); for (i = 0; i #include #include typedef struct tree_cs { char word[82]; /* key of the node */ struct tree_cs * first_child; /* pointer to the first child */ struct tree_cs * next_sibling; next_sibling; /* pointer to the next sibling */ } Tree_CS; /* Take reference to lab 2 */ int compare(char *a, char *b) { // Your code here return 0; } void sorting (char **path, int n) { // Your code here For debugging, see if path is sorted. */ for (i = 0; ifirst_child = NULL; T->next_sibling = NULL; name = malloc(sizeof(char*)*80); for (i = 0; i

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!