Discuss the good, the bad and the ugly aspects of their code.
Please be gentle in any criticism - we are all learning!
Have we learnt anything we think would be useful to share with the tutorial?
Include appropriate #defines.
Include a field allowing a linked list to be formed from student structs.
struct student *read_student(FILE *stream)which mallocs a student struct and assigns values to its fields, from values read from a line of the stream, it is given as an argument.
Write a function with this prototype:
struct student *read_students_file(char filename[])which opens the file it is given as argument and calls read_student to create student structs containing the information in the file.
read_students_file should return these student structs as a linked list.
struct student *read_student(FILE *stream)which mallocs a student struct and assigns values to its fields from values read from a line of the the stream it is given as argument.
The file will contain lines specifing zid, student name, lab name and lab grades in this format:
5099703 Tsun Bordignon thu13-sitar A+A+CABAB..A.read_student should return a pointer to the newly created student struct, or NULL if it can not read a line.
Your tutor may still choose to cover some of the questions time permitting.
splitString
which takes a string read by fgets containing
substrings separated by commas, places the substrings in an char[][] array and
returns the number of strings.
You can assume there at most 128 words on the line and no word is more than 32 characters long.
printSubstrings
which prints one per line the substrings in
the char[][] array created in the previous question.
substringsSorted
which given the char[][] array in the previous question
returns 1 if the substrings are increasing order and 0 otherwise.
searchSubstrings
which given the char[][] array in the previous question
returns 1 if the array contains a specified string and 0 otherwise.
substring.c
which reads lines using fgets and calls the above functions.