//#include "stdafx.h"//If the vc++6.0, with this line.
#include
#include "string.h"
int main(int argc,char *argv[]){
char str1[256],str2[256];
int l1,l2;
printf("Input 2 strings...\n");
scanf("%s%s",str1,str2);
if((l1=strlen(str1))>(l2=strlen(str2)))
printf("%s\n",strncpy(str1,str2,l2));
else if(l1printf("%s\n",strncpy(str2,str1,l1));
else
printf("error\n");
return 0;
}