Something like this zach.
Code:
//!! obsolete, don't use #include<conio.h>
#include<stdio.h>
#include <string.h>
// pointless globals
// char str1[10];
// char str2[10];
void writeDes(char str1[],char str2[]);
int main(void)
{
char name[10];
char code[10];
char *p;
fgets(name, sizeof(name), stdin );
if ( (p=strchr(name,'\n')) != NULL ) *p = '\0';
// char *str1 = name;
fgets(code, sizeof(code), stdin );
if ( (p=strchr(code,'\n')) != NULL ) *p = '\0';
// char *str2 = code;
writeDes(name,code);
return 0;
}
void writeDes(char str1[],char str2[])
{
//!! NEVER pass user input as the format string
//to printf.
printf("S1=%s",str1);
printf("\n");
printf("S2=%s",str2);
printf("\n");
}