Advanced C Programming Spring 2004 Excercise 12 (Variable lenght parameter list) Write a function that displays all strings passed as a parameter. C-strings are allways passed as a pointer as you remember. In this case we pass a NULL pointer as a last parameter to indicate that there is no more strings. The following example calls demonstrates how the function is used display_strings(NULL); //Nothing is displayed display_strings("abc", NULL); //abc is displayed display_strings("abc", "defgh", NULL); //two strings are displayed display_strings("abc", "defgh", "hijklmn", NULL); //three strings are displayed display_strings("abc", "defgh", "hijklmn", "opqrstuvxyz", NULL); //four strings are displayed Remark 1. Inside the implementation of display_strings use function puts (not printf with format specifier %s). The reason for this is that then the compiler gives you an error message if you try to pass a parameter that is not of type char *. Type char * is the type of each separate string of course. Remark 2. As you saw in a class, you don't need an assembly language to complete this task. Remark 3. There is no need to use tools in . Remark 4. The function that concatenates all strings would be more useful in real programming situations. Instead of the simplified function above, you can write this kind of more useful function if you like. Anyway, the function above demonstrates the basic idea.