C忘光了,就命!!!!为什么这个小程序调试通过,一执行就会被Windows Kill掉???
运行环境VC++ 6.0 + Windows XP SP2
----------
# include < stdio.h >
# include < string.h >
char *Encipher( char * );
void main()
{
char *source = NULL;
printf("Please input a string :");
scanf("%s", source);
source = Encipher( source );
printf("The string has been enciphered to: \"%s\"", source );
}
char *Encipher( char *t )
{
unsigned j = 0;
unsigned i = 0;
char mapping[2][26]={"abcdefghijklmnopqrstuvwxyz","ngzqtcobmuhelkpdawxfyivrsj"};
char *temp = t;
for( i; i <= strlen(t); i++ )
{
for( j=0; j <= 25; j++ )
if(mapping[0][j] == *temp)
{
*temp = mapping[1][j];
break;
}
temp++;
}
return t;
}