Programming in C autumn 2010
Exercise 6
To the exam you may bring one A4 paper, where you have made your own notes.
You can use both sides of the paper (handwritten or printed). You should
return the paper with you answer sheets after exam.
Return the module of your project work at the latest Oct. 8th.
The course page will have guidance about feedback.
You should give your feedback by Oct. 15th.
The project is recommended to be returned by MONDAY 1, NOVEMBER and it should be returned at latest on MONDAY 8, NOVEMBER 2010.
Oct. 14 2010
#define MAX 100 char* storage[MAX];input() reads the file fname and stores storage lines from this file in the array. Do not make any assumptions about the length of input lines (use a function getline() from Example 10-3). The function input() should then remove all lines that are empty (contain only the end-of-line character, possibly preceded by whitespace characters.) from this array, and report the number of lines that have been removed. Then write the main function which calls input(), and then outputs the contents of the array storage to the standard output stream.
void PrintGen(const void *block, size_t elemSize, size_t blockSize, void (*printIt) (const void*));which prints all elements in the block using the "callback" function printIt. Use the "Traversing a Block of Objects" idiom. Test your program using a block of doubles, and a block of pointers to doubles.