fprintf() gives segmentation fault

Hi,

I am using fprintf to write few strings toa file which has been opened in write mode.
The syntax is as follows:

printf("Testing 7A.\n");
 fprintf(out_screen,"%s|%s|%s|%s|%s|\n",var1,var2,var3,var4,var5);
printf("Testing 8.\n");

When I execute the code It prints "Testing 7A." then prints "Segmentation fault."
Can I have any clue what is wrong I am doing here?

Can you please include the variable declarations and assignment for var1 through var5. If they cannot be cast to a valid string pointer, you will have all sorts of problems.

Thanks a lot m.d.ludwig... I found the bug in my code. The last variale could not be initialized.