im tring to understand that command...
what is it comparing.. what if i was going to use
something like.. a letter instead of a number..
i tried a letter but it just keeps on looping... .. but im tring to understand what the command really does or is...
Code:
int main()
{
char n, x;
char str1[] = "testing partion comparing";
char str2[] = "Testing other comparing";
puts(str1);
puts(str2);
while(1)
{
puts("Enter number of characters to comare, 0 to exit\n");
scanf("%d",&n);
if(n <= 0)
break;
x = strncmp(str1, str2, n);
printf("Comparing %d characters, strncmp() returns %d.\n\n\n",n, x);
}
return 0;
}