Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

Complete the code below:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions